Open domenkozar opened 4 years ago
@domenkozar hasql-pool is mostly a "facade interface" for resource-pool, which doesn't seem to support this. I don't think this is a problem because of the timeout. Process creation is expensive compared to some other small things, but because of the timeout it should be bounded by, worst case, limit / timeout
, e.g. 1 connections/s on average if you have 10s timeout and a limit of 10 connections. Please prove me wrong by adding ekg support to resource-pool ;)
Proved in https://qnikst.brick.do/2020-12-28-resource-pool, for upstream issue follow https://github.com/bos/pool/issues/35
As creating postgresql connection created postgresql worker, opening and closing them is expensive.
https://www.pgbouncer.org/ allows specifying the minimum open connections for that reason and it would be great if hasql-pool can do the same.