OK well if you’re using gevent, then I really have very little experience to help you on this. I wasn’t aware of what integration gevent has with the MySQL drivers, I assume you’re using a pure Python driver at least. It’s very likely there’s some interaction with gevent + MySQL drivers getting in the way. That’s a pretty advanced configuration so you sort of need to figure out how to get a handle on what it’s doing if you want to roll that way. I love the idea of gevent but as far as real world use cases, I’ve never had any. If i need parallelism i just throw up multiprocessing and I’m done. But i know that’s just not exciting enough for most people.
you’d need to run what you’re doing under non-gevent, non-parallel circumstances and get a baseline for how long a “commit” takes. On Mar 13, 2014, at 9:30 AM, Ni Wesley <[email protected]> wrote: > I thought this before. > > But, actually, set to 0 is twice as fast as other settings, say, maybe 50, > really hard to understand. > > I tried to use gevent + sqlalchemy + mysqlconnector, but just a little > improve. > > Tomorrow I wanna write some mysql procedures and call the procedures , > instead of core sqls. > > 在 2014年3月13日星期四UTC+8下午8时59分34秒,Michael Bayer写道: > > On Mar 13, 2014, at 12:10 AM, Ni Wesley <[email protected]> wrote: > > > > > We can see that, from the start point to end point, it takes 50 ms, > > including 40ms for engine commit. > > > > For 1000 entries, it takes 40 seconds, here I have one question, when 1000 > > connections are on-going, I watch the connections between tcp server and db > > server, > > > > via command watch -n 1 "netstat -anpto|grep dbserver_ip|wc -l", I find the > > spike value is just 26, actually, I gave 0 to engine pool_size, why it > > takes only 26? > > pool size as zero is a pretty bad setting here, it means for every > connect/execute() it has to reconnect to the database from scratch, because > connections aren’t pooled. > > taking off that setting and leaving at the default would help. > > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
