'Force blocking call for django in gevent worker of gunicorn
I have a django project run in gunicorn which has gevent as its thread class. Now for some parts of my program I need to call redis to get a key. This part runs inside an atomic block and must run as fast as possible. But when gevent monkey patch all libraries, it causes redis invoked non blocking and other greenlet starts processing which has very poor performance for me. How can I force redis or gevent to call this part blocking and get me the key without yielding the greenlet?
I am using django 3.1 and gunicorn 20.0.4 with python redis client.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
