At Thumbtack we run a few Python services via Gunicorn WSGI HTTP server. As those services are mostly I/O bound, gevent is a great choice for them. However, we have encountered a few issues with this combination, and would like to share the solutions we have found.
Lesson 1: Avoid multiprocessing.Queue
The first issue we encountered was noticing critical timeouts in our error log, something like:
[CRITICAL] WORKER TIMEOUT (pid:151)
As the logs didn’t contain anything else that would help us, we first needed a way to reliably reproduce the issue.