pserve + gunicorn causing some issues

91 views
Skip to first unread message

Sontek

unread,
May 7, 2013, 6:59:15 PM5/7/13
to pylons-...@googlegroups.com
When using this configuration setup:

[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 9920
worker_class = gunicorn.workers.ggevent.GeventWorker
workers = 4



I'm getting errors like:

SQLALchemy:

    SAWarning: At least one scoped session is already present.  configure() can not affect sessions that have already been created.


and with dogpile.cache:

    Exception: This region is already configured with backend: <dogpile.cache.backends.redis.RedisBackend object at 0x2950f90>




If you use gunicorn_paster everything works just fine.  Anyone know what causes pserve to have trouble with these and if there
is a workaround?

Nikolay Kim

unread,
May 7, 2013, 7:05:20 PM5/7/13
to pylons-...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To post to this group, send email to pylons-...@googlegroups.com.
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

John Anderson

unread,
May 7, 2013, 7:10:03 PM5/7/13
to pylons-...@googlegroups.com

On Tue, May 7, 2013 at 4:05 PM, Nikolay Kim <fafh...@gmail.com> wrote:


On May 7, 2013, at 3:59 PM, Sontek <son...@gmail.com> wrote:

When using this configuration setup:

[server:main]
use = egg:gunicorn#main
host = 0.0.0.0
port = 9920
worker_class = gunicorn.workers.ggevent.GeventWorker
workers = 4



I'm getting errors like:

SQLALchemy:

    SAWarning: At least one scoped session is already present.  configure() can not affect sessions that have already been created.


and with dogpile.cache:

    Exception: This region is already configured with backend: <dogpile.cache.backends.redis.RedisBackend object at 0x2950f90>




If you use gunicorn_paster everything works just fine.  Anyone know what causes pserve to have trouble with these and if there
is a workaround?

We would like to stick to being able to use pserve so that we can swap out webservers based on configuration if possible.  It seems to be
possible since gunicorn_paster seems to work just fine.  

Alvaro Aguirre

unread,
May 7, 2013, 7:47:02 PM5/7/13
to pylons-...@googlegroups.com

are you using the Zope Extension for SQLAlchemy?

I got similar errors using it with gevent.

Removing this extension everything worked fine again.

--

Chris McDonough

unread,
May 7, 2013, 7:52:45 PM5/7/13
to pylons-...@googlegroups.com
On Tue, 2013-05-07 at 16:10 -0700, John Anderson wrote:
>
> On Tue, May 7, 2013 at 4:05 PM, Nikolay Kim <fafh...@gmail.com>
> wrote:
> You probably should use something like
> https://github.com/fafhrd91/pyramid_sockjs/blob/master/pyramid_sockjs/paster.py
>
>
>

> We would like to stick to being able to use pserve so that we can swap
> out webservers based on configuration if possible. It seems to be
> possible since gunicorn_paster seems to work just fine.

FTR, the setuptools entry points that make "pserve" and "paster serve"
work ("paste.server_runner") are the same, and work exactly the same, so
they should be interchangeable.

- C



Sontek

unread,
May 7, 2013, 10:26:14 PM5/7/13
to pylons-...@googlegroups.com
I was talking about:



which seems to be doing something a little different than pserve because I don't have these issues in it. 

Chris McDonough

unread,
May 7, 2013, 10:38:16 PM5/7/13
to pylons-...@googlegroups.com
Not sure what "in it" means because when you use "use =
egg:gunicorn#main" in your [server] section, the "paste_server" function
in the file you reference above will be executed by pserve.

- C



Reply all
Reply to author
Forward
0 new messages