Currently, if the maximum connection count is reached and none is available,
Proxool will throw an SQLException if one tries to obtain a new connection
from the pool.
(tell me if I'm wrong)
In some cases one would expect his request to block until one becomes
available or a timeout occurs (a bit like blocking IO).
I remember this issue in a previous thread. Bill's answer was:
- dimension your max connection properly taking the maximum concurrent user
your application can accept (scaling issue);
- if the limit is reached - then your application has probably reached its
limit too. Therefore queueing the new request won't help and will even
contribute to DOS of your app.
Well... Yes and no :)
There are situations were you want to limit the number of real connections
to your database independently of other factors. For licensing reasons for
example (you are licensed to 10 simultaneous connections) or because of
company policies (your DB is shared with others and your DBA doesn't give
you more than x connections), etc.
I was thinking about a more flexible approach: *hard* and *soft* limit (a
bit like the disk quotas):
- soft limit: when the soft limit is reached, new connection requests are
blocked until one becomes available;
- hard limit: an exception is thrown when the number of used
connections+queued connections reaches the hard limit
(soft limit == hard limit == current behavior)
Comments ?
-bertrand
(will come with new ideas every night ;)
|