On Mar 3, 2008, at 9:36 PM, Lukasz Szybalski wrote:

> I'll add
> sqlalchemy.pool_recycle = 3600 to my prod.cfg (turbogears)
>
> How is the pool recycle going to affect performance?

used properly, pool recycle has a negligible effect on performance.   
every X amount of seconds (which you should configure to be like, an  
hour), a connection in the pool will be closed and a new one reopened  
on the next grab.

> It seems to me
> that if 1000 people hit my website it will open  1000 connection to
> mysql.

only if your webserver could handle 1000 simultaneous threads (it cant  
unless you have a hundred gigs of ram)....but even in that case the  
pool throttles at 15 connections by default so simutaneous requests  
over that number would have to wait to get a DB connection.  You'd  
want to set pool_size and max_overflow to adjust this.

> Assuming limiter number of connections my website will shut
> down.  How does that change with pool_recycle?

pool_recycle has nothing to do with how many simultaneous requests can  
be handled, it just controls the lifecycle of connections that are  
pooled.


> What happens sqlalchemy to mysql connections if if I set:
> server.thread_pool = 30

assuming that determines how many simultaneous threads handle  
requests, the number of connections opened would most likely max at 30  
if you set the pool_size/max_overflow to allow it, and also you only  
used one connection per request (i.e. didnt open a second one to write  
to a different transaction or something).

- mike

--~--~---------~--~----~------------~-------~--~----~
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