4 ms·
You can tell how Gunicorn is old by looking at example showing only 4 workers :)
by bartq 5y ago
You can tell how Gunicorn is old by looking at example showing only 4 workers :)
- sgt 5y ago4 highly skilled workers. Imagine how much 4096 workers would cost?
- tgv 5y ago4TB.
- nickjj 5y ago> You can tell how Gunicorn is old by looking at example showing only 4 workers :) I've seen folks run a $90,000 / month business through their SAAS app using gunicorn on a 2 CPU core box (4 workers). Nothing wrong with being efficient!
- dfox 5y ago4 workers is the sweet spot for most wsgi applications. Typically you will scale above that by running additional complete gunicorn instances (managed by some kind of external scaling/load balancing thing). If it makes sense for your application to run more than 4 workers in one gunicorn instance (ie. you have long running requests that only wait on something) then gunicorn (and in fact, "normal" wsgi itself) probably is not the right solution for your application. Edit: somewhat typical issue with scaling python applications is that just throwing additional workers at the problem in the same instance of the wsgi container (including separate uwsgi processes) stops being effective fairly soon and makes the problem worse.
- WesleyJohnson 5y agoWe're running Gunicorn behind Nginx for an internal Django web application. I thought the rule of thumb was to scale workers = (Cores * 2) + 1?
- whouweling 5y agoIn my experience it also depends on the worker type, if you are running sync you might need more workers depending on how much your database can handle. Otherwise the number of workers might limit the total throughput quite severely.
- qeternity 5y agoWe run single worker Uvicorn instances...we just run lots of them (behind an HAProxy sidecar).