This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the python category.
Last Updated: 2024-11-23
I ran gunicorn
with gunicorn mysite.asgi:application --pythonpath mysite --timeout 15 --max-requests 10000 --worker-class uvicorn.workers.UvicornWorker --bind unix:/tmp/asgi.sock
--max-requests
is a gunicorn config for a memory leak. It causes restart after that requests. If we do not have a memory leak, we will improve performance by removing this.--timeout
causes gunicorn to restart worker if it hasn't done work in X seconds. Default is 30s. Lower timeouts are better for high request volumes.
--bind
- taking a unix socket for nginx here. But could be 0.0.0.0:8000
for ip socket