async-kit
async-kit copied to clipboard
Ability to set minConnections for pool
It would be great to have an ability to configure minimum size of the connection pool
Moving this to NIOKit since that is where ConnectionPool
lives now.
How/when would this be beneficial? It’d still have a max and pick a new connection up when needed? Or would you always have x
amount of connections connected?
Might slightly decrease latency (especially in case of a sudden "burst" of parallel requests) because we are more likely to not need to fire up a new connection for these. But I agree that the semantics are a bit unclear per se, and it should also have less effect once the connection pool is "warm" (i.e. filled with as many connections are needed for regular operation).
But while decreasing latency, would this not also increase the performance hit by keeping alive connections that are not needed? (I guess that'd be a tradeoff an end user would have to make)
Yes, but the performance hit of excess idle connections should be negligible.
On 19. Feb 2019, at 19:02, Jari (LotU) [email protected] wrote:
But while decreasing latency, would this not also increase the performance hit by keeping alive connections that are not needed? (I guess that'd be a tradeoff an end user would have to make)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I'm not into the whole performance world enough to judge that, so I'll take your word for that.
In this case it seems like a good addition, feel free to open a PR :)