-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does the pool support "idle" connection ? #19
Comments
The pool maintains a fixed number of connections, which is specified via the |
oh then my question is reversed : how can i set the maximun number of connection my pool will reach ? i.e is it possible to have both "set max idle connection" and "set max open connection" like in go https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns |
|
I see, is it something that you think may be useful to implement ? |
It's not totally clear to me what purpose |
actually it's a pretty frequent use case, at least in the companies I've worked you have a database used by several systems, or like in amazon, with a hard limited number of connection
this carefull management of number of connection opened is especially important in cloud-based services, where your postgresql instance are priced by number of max connection, and from one instance size to an other you can easily double or halfed the price |
At least for Amazon RDS, you're billed based on hardware and storage requirements, not active connections, right? For some workload, there is an optimal number of connections at which throughput and cost is optimal. What is the downside in maintaining exactly that number of connections at all times? What are the resources being conserved for? In any case, I'm not so opposed to allowing the pool size to be non-fixed, but I'm not sure what the configuration parameter should be. Go's pool has |
The main argument I got for that is that by keeping a number > 0 (and < Max pool size) of connection at anytime, you prevent yourself from being starved by other application (while trying to not be too greedy by keeping it < Max pool size) |
As for RDS, my bad, I discovered only today that it's possible to change the max number of connection (cargo cult in my team), but as it's not something that can be changed dynamically, my point above still stands |
I think I'm leaning towards the Hikari/c3p0 config strategy, though those will require some more functionality to be added that I've been meaning to do for a while (max idle time, for example). |
ok great, thanks :) |
There are now three new configuration options.
Seem like that'll work? |
awesome , yes it should do the trick |
Released v0.6.2 with these changes. |
I don't see anywhere how to set the pool so that it keeps X number of connections open at any moments to keep the pool warm in case of burst ?
The text was updated successfully, but these errors were encountered: