码迷,mamicode.com
首页 > 数据库 > 详细

gevent mysql

时间:2018-05-08 14:42:52      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:mysql   gre   tps   href   http   com   stack   影响   之间   

使用gevent实现mysql并发时,每个greenlet应该独享一个mysql连接,否则,不同的greenlet之间会相互影响。

ultramysql doesn‘t allow you to make multiple queries on the same mysql connection, it just makes it async friendly. So you will either need a new mysql connection for each greenlet or use locking primitives to makes sure only one greenlet is using the connection at a time.

https://stackoverflow.com/questions/13308446/how-to-insert-async-into-mysql-using-python

gevent mysql

标签:mysql   gre   tps   href   http   com   stack   影响   之间   

原文地址:https://www.cnblogs.com/buxizhizhoum/p/9007477.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!