[Django]-Long running requests with gunicorn + nginx

4👍

Are you connecting directly to gunicorn? Or is there an ngnix or so in between? There are some 90 second timeouts in nginx if I recall correctly.

As an aside, for such ill-performing requests, there are generally two solutions:

  • Cache the result and get a cron job to call a custom django management command that does the calculation and fills the cache.

  • An asynchronous task queue like celery does the actual calculation and you do a separate request to check if it’s ready.

0👍

Have you tried Asynchronous workers in Gunicorn?

Especially good for slow requests et al..

Leave a comment