[Solved]-Making a POST request to an external URL from a django + gunicorn + nginx setup

6πŸ‘

βœ…

In my gunicorn settings, setting workers=2 solved this issue.

When I was sending a request to the external URL, the external application would send a request back. This new request would occupy the one and only worker in the application. The original request that I sent out is workerless, and so it get’s stuck.
With 2 workers, I am able to simultaneously send out a request and receive another request.

πŸ‘€SeeknInspYre

0πŸ‘

You could have issues with Nginx, where the problem could be nginx request entity too large. If you sending too large data to the server, Nginx might reject the request. We had issues with Nginx causing problem when we were trying to upload too big image. We also using nginx + gunicorn with django. So I am suspecting. this might be the same issue.

πŸ‘€Vinit Kumar

-2πŸ‘

This is a gunicorn timeout issue. You can increase the timeout of gunicorn by specifying the additional flag --timeout 60 in the command you’re using to execute gunicorn. Of course, you can customise the timeout length depending on your needs. The argument is in seconds.

Leave a comment