Hi Jason,

thanks for the reply.

My pylons basecontroller takes care of the session clean up
like this:

class BaseController(WSGIController):
    def __call__(self, environ, start_response):
        try:
            return WSGIController.__call__(self, environ,
start_response)
        finally:
            model.Session.remove()

When I use model.Session.close(), everything works.
But error comes whenever i change it to model.Session.remove().
AFAIK, remove() make more sense than close() on a real site with
dynamic load
which is learned from SA docs.


I changed your script a little to do the test again.
The result is just the same as described above:

* with Session.close(), everything works just fine even 'ab -c 500'
* with Session.remove(), the script caught timeout exceptions in
minutes.

Best

Jian


On Aug 29, 10:05 pm, jason kirtland <[EMAIL PROTECTED]> wrote:
> Jian wrote:
>
> > Hi List:
>
> > I am just doing a test of my pylons site under medium load.
> > (ab2 -c 20 -n 5000 ...)
>
> > and got following errors:
>
> > 2007-08-29 17:32:34,468 INFO  [paste.httpserver.ThreadPool]
> > kill_hung_threads status: 10 threads (10 working, 0 idle, 0
> > starting) ave time 2.24sec, max time 7.22sec, killed 0 workers
> > 2007-08-29 17:32:40,874 INFO  [paste.httpserver.ThreadPool]
> > kill_hung_threads status: 10 threads (10 working, 0 idle, 0
> > starting) ave time 7.28sec, max time 13.63sec, killed 0 workers
> > Error - <class 'sqlalchemy.exceptions.TimeoutError'>: QueuePool
> > limit of size 5 overflow 10 reached, connection timed out,
> > timeout 30 Error - <class 'sqlalchemy.exceptions.TimeoutError'>:
> > QueuePool limit of size 5 overflow 10 reached, connection timed
> > out, timeout 30
>
> > Some Details of test environment:
> > [...snip...]
>
> How are you managing your sessions and connections?  Most likely
> connections are being held somewhere, starving the pool.
>
> A basic setup and query like you've described, served via Paste's
> server doesn't skip a beat for me even when run with 'ab -c 500'.
>
> def wsgi_app(environ, start_response):
>     start_response('200 OK', [('Content-Type', 'text-plain')])
>     entities = Data.query.all()
>     page = ','.join([e.data for e in entities])
>     elixir.objectstore.close()
>     return [page]
> paste.httpserver.serve(wsgi_app)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to