Frequent worker timeout

We had the same problem using Django+nginx+gunicorn. From Gunicorn documentation we have configured the graceful-timeout that made almost no difference. After some testings, we found the solution, the parameter to configure is: timeout (And not graceful timeout). It works like a clock.. So, Do: 1) open the gunicorn configuration file 2) set the TIMEOUT to … Read more

Make sure only one worker launches the apscheduler event in a pyramid web app running multiple workers

Because Gunicorn is starting with 8 workers (in your example), this forks the app 8 times into 8 processes. These 8 processes are forked from the Master process, which monitors each of their status & has the ability to add/remove workers. Each process gets a copy of your APScheduler object, which initially is an exact … Read more

Gunicorn, no module named ‘myproject

Your error message is ImportError: No module named ‘myproject.wsgi’ You ran the app with gunicorn –bind 0.0.0.0:8000 myproject.wsgi:application And wsgi.py has the line os.environ.setdefault(“DJANGO_SETTINGS_MODULE”, “settings”) This is the disconnect. In order to recognize the project as myproject.wsgi the parent directory would have to be on the python path… running cd .. && gunicorn –bind 0.0.0.0:8000 … Read more

Debugging a Flask app running in Gunicorn

The accepted solution doesn’t work for me. Gunicorn is a pre-forking environment and apparently the Flask debugger doesn’t work in a forking environment. Attention Even though the interactive debugger does not work in forking environments (which makes it nearly impossible to use on production servers) […] Even if you set app.debug = True, you will … Read more

Gunicorn worker timeout error

We had the same problem using Django+nginx+gunicorn. From Gunicorn documentation we have configured the graceful-timeout that made almost no difference. After some testings, we found the solution, the parameter to configure is: timeout (And not graceful timeout). It works like a clock.. So, Do: 1) open the gunicorn configuration file 2) set the TIMEOUT to … Read more