nikita-volkov / hasql-pool

A pool of connections for Hasql
http://hackage.haskell.org/package/hasql-pool
MIT License
17 stars 15 forks source link

minimal connections #10

Open domenkozar opened 4 years ago

domenkozar commented 4 years ago

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.

roberth commented 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 ;)

domenkozar commented 3 years ago

Proved in https://qnikst.brick.do/2020-12-28-resource-pool, for upstream issue follow https://github.com/bos/pool/issues/35