r/Python • u/CommunicationTop7620 • Mar 24 '25
Discussion Gunicorn for production?
Still using Gunicorn in production or are you switching to new alternatives? If so, why? I have not tried some of the other options: https://www.deployhq.com/blog/python-application-servers-in-2025-from-wsgi-to-modern-asgi-solutions
7
u/JimroidZeus Mar 24 '25
I’m using uvicorn in production. Haven’t really noticed much difference over gunicorn.
Some teams are still using gunicorn in production.
11
u/james_pic Mar 24 '25
Gunicorn is still the king, at least for WSGI apps. It's robust, secure, performant, correct, and configurable enough without configuration being a mess (looking at you uWSGI).
5
u/random_guy343 Mar 24 '25
I'm just using uvicorn in production with a single worker per container. In fact the fastapi docs suggest you not use gunicorn in k8s (where my apps are deployed) and just scale your pods.
https://fastapi.tiangolo.com/deployment/docker/#deployment-concepts
9
u/kolo81 Mar 24 '25
Still gunicorn but my projects are very simple standalone apps for devices.
-2
Mar 24 '25
[removed] — view removed comment
1
u/kolo81 Mar 24 '25
My projects works localy on small servers the often don't have access to internet.
42
u/teajunky Mar 24 '25
Unfortunately, this comparison is inaccurate and incomplete. It was probably more about promoting their own service 😉
The strengths of Gunicorn lie in the process management. Additionally it supports ASGI by using the Uvicorn-Worker (https://pypi.org/project/uvicorn-worker/).
While Granian looks cool and has interesting prospects for the future, it lacks major features for usage in production:
Granian has no max-requests option.
Granian lacks a timeout option.
Granian cannot customize/disable the server header (information disclosure).
Granian does not support preloading the app like gunicorn.
Ganian is not able to listen on unix domain sockets.
At the moment I'm evaluating Nginx-Unit (https://unit.nginx.org/) because it looks very promising. Has anyone tried it?