-
I'm running the docker on an AWS instance and I have an endpoint that performs heavy calculations. Depending on the input it can take more than 1 minute to process. The problem is that for big inputs it always returns a 504 Gateway Timeout after 60 seconds. I've tried to set the TIMEOUT parameter in the docker run command as specified in the docs but it doesn't seem to modify this timeout. I've checked the gunicorn documentation and it says that the default timeout is 30 seconds and the grace_timeout is also 30 seconds. This make me think that these parameters are not being overwritten because the sum of both is 60 seconds, exactly the same time it takes to raise the timeout error. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you're using an ELB in front of your instance, it might be the Load Balancer closing the connection (default timeout is 60s) |
Beta Was this translation helpful? Give feedback.
-
Now that Uvicorn supports managing workers with Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#-warning-you-probably-dont-need-this-docker-image That should also make all the configs much simpler as it's just Uvicorn and not also Gunicorn on top with all its interactions. |
Beta Was this translation helpful? Give feedback.
Now that Uvicorn supports managing workers with
--workers
, including restarting dead ones, there's no need for Gunicorn. That also means that it's much simpler to build a Docker image from scratch now, I updated the docs to explain it.Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#-warning-you-probably-dont-need-this-docker-image
That should also make all the configs much simpler as it's just Uvicorn and not also Gunicorn on top with all its interactions.