4 ms·
You can of course do parallel HTTP calls or database queries with Python's existing threads (IO releases the GIL in Python) or via multiprocessing. You don't h
by calpaterson 6y ago
You can of course do parallel HTTP calls or database queries with Python's existing threads (IO releases the GIL in Python) or via multiprocessing.
You don't have to use locks either - straight parallelism can be done very easily with the Executors in concurrent.futures. There are a lot of good concurrency primitives in the threading library in the stdlib including conditions, semaphores and barriers. Of course best to avoid parallelism with shared data if at all possible (and IMO it doesn't really come up much).
- jordic 6y agoThe thing is that you can serve a lot of requests on a single core.. (and at least us we pay per core)
- calpaterson 6y agoYou can use multiple threads and multiple processes on a single core - that is the purpose of timesharing operating systems after all.
- jordic 6y agoFor example: https://discuss.tryton.org/t/wsgi-server-choice/2766 https://discuss.tryton.org/t/wsgi-server-choice/2766 https://mail.zope.org/pipermail/zodb-dev/2010-December/013897.html https://mail.zope.org/pipermail/zodb-dev/2010-December/01389... https://docs.rhodecode.com/RhodeCode-Enterprise/admin/tuning-gunicorn.html https://docs.rhodecode.com/RhodeCode-Enterprise/admin/tuning... https://github.com/benoitc/gunicorn/issues/1045 https://github.com/benoitc/gunicorn/issues/1045