python

python3 flask + pymongo + gevent, locust testing hangs

시간을 거스르는자 2017. 9. 26. 17:28

monkey.patch_all(thread=False)

Remove "thread=False".

This makes thread hanging.


Refer to usage of pymongo + gevent on below site

http://api.mongodb.com/python/current/examples/gevent.html

https://stackoverflow.com/questions/7166998/pymongo-gevent-throw-me-a-banana-and-just-monkey-patch

They are telling,

"By default, PyMongo uses threads to discover and monitor your servers’ topology (see Health Monitoring). If you execute monkey.patch_all() when your application first begins, PyMongo automatically uses greenlets instead of threads."