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 <nis...@gmail.com <javascript:>> > 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.