Do I need call monkey.patch_all() in Django+Gunicorn+GEvent+Boto structure?

我怕爱的太早我们不能终老 提交于 2019-12-11 02:36:35

问题


My website is using Django+Gunicorn+GEvent. There is a function which I have to use Boto for DynamoDB.

Do I need call monkey.patch_all() to make Boto become greenlet?


回答1:


If you use the default worker_class configuration, then you don't have the features of gevent. Look the doc here. I think you don't have the advantage of using gevent when you use the default configuration even though you monkey patch all.

So you should configure gunicorn to use the GeventWorker which does the monkey.patch_all() operation and in this situation, I think you don't have to monkey patch all. Here is the source code of GeventWorker and the doc about worker_class



来源:https://stackoverflow.com/questions/20425165/do-i-need-call-monkey-patch-all-in-djangogunicorngeventboto-structure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!