3 ms·
I recently started playing around with Google Cloud Run and am running some python/flask/gunicorn code in a docker container on the platform. I noticed in the
by doctoboggan 7y ago
I recently started playing around with Google Cloud Run and am running some python/flask/gunicorn code in a docker container on the platform.
I noticed in the logs that I am getting a lot of Critical Worker Timeouts and I am wondering if this has anything to do with it.
- countbayes 7y agoWe had that problem and hacked around it with the Dockerfile instructions below, if you find a better solution that would be great :) --Dockerfile snippet-- # Cloud Run concurrency is assumed to be set to 10 but we don't assume that is exact # See 'https://github.com/benoitc/gunicorn/issues/1801' https://github.com/benoitc/gunicorn/issues/1801' so disabling concurrency ENV GUNICORN_CMD_ARGS="-c gunicorn_config.py --workers 1 --threads 1 --timeout 120 --preload" CMD [ "gunicorn", "pkg.http:app" ] # Or just use Flask directly if concurrency is set to 1 #CMD [ "python", "cmd/server/main.py" ]
- doctoboggan 7y agoThanks for the pointer. I was messing around with --preload and --timeout flags and they seemed to work, although I think that isn't fixing the root problem.