admin管理员组文章数量:1123704
My Env:
- DJANGO 4.1
- UWSGI 2.0.26 processes + gevent mode
And I Use concurrent.futures.ThreadPoolExecutor as my thread pool
I know that django mysql connecition is thread local. If I create thread pool in request thread, then pool thread id is different in each request so mysql connection is not reused.But if I create thread pool in uwsgi processes,the connection cannot be recycled after request finished and it will throw "Mysql server has gone away" afeter a few time.
So how to reuse mysql connection correctly in my run env?
本文标签: python 3xHow to reuse mysql persistant connection in uwsgidjangomulti threadingStack Overflow
版权声明:本文标题:python 3.x - How to reuse mysql persistant connection in uwsgi + django + multi threading? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736589998a1945062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论