Menu

#16 hard/soft limit on the max number of connections

v1.x (post 1.0)
open
nobody
5
2004-03-17
2004-03-17
No

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.

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)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.