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)


This is how I made my app async (using pyramid alchemy scaffold):
in __init__.py:

import gevent
import gevent.monkey
gevent.monkey.patch_all()

from .lib import psyco_gevent
psyco_gevent.make_psycopg_green()

from pyramid_sockjs.session import Session

def main(global_config, **settings):
    """ This function returns a Pyramid WSGI application.
    """
    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    ...etc...


In  development.ini:

[server:main]
use = egg:gunicorn
host = 0.0.0.0
port = 6543
workers = 2
worker_class = gevent


What happens is that after a few DB queries a query seems to hang & the 
gevent worker  times out. This doesn't happen if I don't 
run make_psycopg_green (but my understanding is then we're not using green 
threads)

Thanks.

-- 
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/-/iCFuNp8P3MMJ.
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.

Reply via email to