This 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/ 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
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).
Re:A viable solution for Python concurrency
by btown on Friday October 15, 2021 @11:29PM
(#28885325)
Yep, 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!
Re:A viable solution for Python concurrency
by sandGorgon on Saturday October 16, 2021 @01:34AM
(#28885782)
you 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.
Are you able to fully utilize a multicore processor? I'm not familiar with gevent.