nope. DAL retains a connection pool, opening at most pool_size connections.
For threaded webservers, this means that every connection instantiate a new
connection until pool_size is reached. Connections are then recycled (as
opposed to trashed) for every new incoming request.
For multiprocess webservers (ones that relies on fork()) instead pool_size
is unconsequential (i.e. better to set it to 1): every new process
"inherits" the connection and work with that.
On Sunday, May 26, 2013 8:34:40 AM UTC+2, Saba wrote:
>
>
> Hi,
>
> I have a question please regarding db connections and connection pooling
> in web2py.
>
> In models/db.py, I have a connect string like this:
>
> db=DAL('mysql...',pool_size=5)
>
> does model files get executed for every request? If so, then does it
> create the above db connection for every request?
>
> For eg, if there are 10 requests, does it create 50 separate db
> connections ( 10 requests * 5 pool_size)?
>
> Please let me know. Appreciate your response.
>
> thanks,
> Saba
>
>
>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.