-
I'm running the uvicorn-gunicorn-fastapi:python3.7 Docker-Image on an Azure App Service (B2: 200 ACU, 2 Cores, 3.5 GB Memory, OS: Linux). My Dockerfile looks as follows:
The service accepts POST requests with a file attached and processes it using tesseract and open-cv. Oftentimes, however, the processing stops with the following error:
This error does not occur after the default timeout of 120 seconds. Still, I tried to get rid of the error by using a custom Does anyone know a solution for the problem? Running the Docker-Container locally works just fine (Windows 10, Docker Engine v19.03.13) |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
What's up @moelliDo, did you find some answer for the problem? I'm experiencing the same issue and i'm not able to find the cause. When running locally it works just fine, but in production (EC2 with docker) the problem just happens. |
Beta Was this translation helpful? Give feedback.
-
Hi @mateusjs. App Services in Azure time out after 230 seconds by default and - AFAIK - this timeout can't be configured. So we managed to improve the services logic such that the timeout wasn't a problem anymore. |
Beta Was this translation helpful? Give feedback.
-
Hello @moelliDo. I'm currently having a very simmilar problem. In my case, the workers are timing out after only two seconds of getting the request. How much time passed before your workers timed out?
|
Beta Was this translation helpful? Give feedback.
-
Hi @guillermoetchebarne my workers timed out after about 120-180 seconds after the request was received by the service. Two seconds is really quick. How did you deploy your service? Did you adjust the config somehow? |
Beta Was this translation helpful? Give feedback.
-
Indeed this is a real issue, originally brought up in #46. The solution provided there could help in some cases, however, in the cases we've seen, we haven't even come close to reaching the default 120 second graceful timeout period. |
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 Using just Uvicorn and not Gunicorn on top would probably make everything much simpler as there's no extra complexity in the interaction between Uvicorn and Gunicorn. |
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
Using just Uvicorn and not Gunicorn on top would probably make everything much simpler as there's no extra complexity in the interaction between Uvicorn and Gunicorn.