3 ms·
> our web servers and batch workers have throughput limited only by CPU and RAM Are you able to fully utilize a multicore processor? I'm not familiar with geve
by Buttons840 5y ago
> our web servers and batch workers have throughput limited only by CPU and RAM
Are you able to fully utilize a multicore processor? I'm not familiar with gevent.
- js2 5y agoThis is why you run one process per core, and you'll typically have something like nginx+uWSGI distribute requests across them. I use this combination with https://falconframework.org/ https://falconframework.org/ and boto3 to spool HTTP POST requests to S3 and SQS and am pretty happy with it. uWSGI supports gevent https://uwsgi-docs.readthedocs.io/en/latest/Gevent.html https://uwsgi-docs.readthedocs.io/en/latest/Gevent.html Falcon also benefits from Cython acceleration. It's been a while but at the time I tested against PyPy and either it was slower or had quirks I was unable to resolve (don't recall w/o consulting my notes).
- btown 5y agoYep, we use Gunicorn in full gevent mode, tuned to spawn and route to a gevent-patched Django process per core, each of which can handle as many concurrent requests as will fit in (its slice of) RAM. A far cry from the one-request-per-thread days of yore!
- sandGorgon 5y agoyou use gunicorn as a reverse proxy - it seems that you are not running Gunicorn to spawn django processes is it ? I'm wondering how would this work in a kubernetes/docker world.
- btown 5y agoGunicorn both acts as a reverse proxy and a master process that forks workers - each of which, in our case, loads Django. https://docs.gunicorn.org/en/stable/design.html https://docs.gunicorn.org/en/stable/design.html