[email protected] wrote on 04/12/2012 05:42:00 PM: > Michael Bayer <[email protected]> > Sent by: [email protected] > > 04/12/2012 05:42 PM > > Please respond to > [email protected] > > To > > [email protected] > > cc > > Subject > > Re: pyramid async setup > > On Apr 12, 2012, at 3:27 PM, binadam wrote: > > On Thursday, April 12, 2012 12:24:42 PM UTC-7, binadam wrote: > Hello all, > > I used the following cookbook for an asynchronous setup: > http://michael.merickel.org/2011/6/21/tictactoe-and-long-polling-with-pyramid/ > but ran into problems. > > First I'd be interested to know if anyone has successfully done this > (in production environment) using the following packages (or > something similar): > pyramid > gunicorn + gevent > postgresql (with psycopg2 made green) > > I should also add sqlalchemy > > I'm playing with this right now. > > It's working for me, here are the two things I'm observing so far. > > 1. it might be better to use NullPool with create_engine(), not sure > yet. This eliminates all connection pooling. I'm not sure if > theres's some kind of twinge with using a psycopg2 connection in a > greenlet that it wasn't created in, the statement at http:// > initd.org/psycopg/docs/advanced.html#support-to-coroutine-libraries > doesn't seem to say this, but I am seeing it "hang" more often if I > don't use NullPool.
given how slow postgresql is in setting up connections, it still would seem that you need a pool. how about using an external pool server like pgbouncer > > 2. then it runs great, but watching this go, I can see that there > might be a greater chance of old fashioned deadlocks occurring, it's > not clear yet. Try running "ps -ef | grep post" or select from > pg_stat_activity to see if anything is just locking. > > script is attached > > with gevent I can run through about 55K rows of work in 53 seconds, > with threads it takes 66 seconds. > -- > You received this message because you are subscribed to the Google > Groups "pylons-discuss" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to pylons-discuss > [email protected]. > For more options, visit this group at http://groups.google.com/ > group/pylons-discuss?hl=en. > > > -- > You received this message because you are subscribed to the Google > Groups "pylons-discuss" group. > To view this discussion on the web visit https://groups.google.com/ > d/msg/pylons-discuss/-/SvFCNJmz7A0J. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to pylons-discuss > [email protected]. > For more options, visit this group at http://groups.google.com/ > group/pylons-discuss?hl=en. > [attachment "stress_sqla.py" deleted by Jim Penny/LBG/UFI/YKKNCA] -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
