5 ms·
And nobody should be using gunicorn, it's way less performant than uWSGI uWSGI may be different now, but 4 years ago I built a browser toolbar C&C API serv
by CoffeeDregs 11y ago
And nobody should be using gunicorn, it's way
less performant than uWSGI
uWSGI may be different now, but 4 years ago I built a browser toolbar C&C API server that peaked at about 2k requests per second. We used uWSGI to front our Django application with SoftLayer HTTP load balancers in front of uWSGI. uWSGI was speaking HTTP and translating to WSGI, but did so only in one thread/process. So while 8-16 Django threads were tootling along, the single uWSGI HTTP->WSGI thread was pegged. We switched to gunicorn and had dramatically better performance.
- Beltiras 11y agoSounds more like a crappy setup than a problem with uWSGI itself. I know it has a steep learning curve. I know that it takes time and effort to change out software pieces that have a long history within an organization (I have some experience in that department) even when a clear and technically superior alternative is available. I have a drawing of my favorite infrastructure that solves a ton of problems before I code one line of anything. nginx -> uWSGI -> Python(Django) -> Celery(via RabbitMQ) -> Postgres It's a bit more complicated than this and redis is missing but it's a nice linear representation of how I like to structure things. The only thing there not lightning-fast is Django but it doesn't need to be. I'm spending most of my time in the other pieces of software.
- CoffeeDregs 11y agoSounds more like a crappy setup than a problem with uWSGI itself. No. As I detailed, it was a deficiency with uWSGI itself. Complicating the setup as you suggest is a crappy workaround for a uWSGI deficiency. We simplified the setup by switching to gunicorn. I would still use uWSGI, but, as with all software/tools, I would be aware that it has a deficiency. uWSGI docs on production usage of HTTP functionality don't mention this issue so I wanted to let others know. https://uwsgi-docs.readthedocs.org/en/latest/HTTP.html?highlight=http#can-i-use-uwsgi-s-http-capabilities-in-production https://uwsgi-docs.readthedocs.org/en/latest/HTTP.html?highl... I have a drawing of my favorite infrastructure Wish I had the luxury. We're running 20-30 projects/applications (~3000 tasks) across our clusters. Some are Django fronted by gunicorn, some are directly fronted by flask, but 80% are non-HTTP services.
- Veratyr 11y agoYou can deal with this by having NGINX load balance and translate from uWSGI's binary protocol to HTTP: https://uwsgi-docs.readthedocs.org/en/latest/Nginx.html https://uwsgi-docs.readthedocs.org/en/latest/Nginx.html
- Beltiras 11y agoIt's well worth the effort to get uWSGI running under it's native protocol. Here's a must-read if you use it: http://uwsgi-docs.readthedocs.org/en/latest/ThingsToKnow.html http://uwsgi-docs.readthedocs.org/en/latest/ThingsToKnow.htm...