yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.2k stars 160 forks source link

Is there any way to specify min connections? #178

Open atrauzzi opened 4 years ago

atrauzzi commented 4 years ago

We're troubleshooting an issue right now where we think that occasionally odyssey will initialize a new connection due to load. Unfortunately, when this happens, the request that caused the connection to initialize is stuck paying the performance penalty of connection startup.

If we configure odyssey for example 20 connections, is there any way to have odyssey open all 20 of them at start so that they are warm?

x4m commented 4 years ago

@atrauzzi nope, but you can create such a setting. Just copy-pase everything from pool_ttl and modify expiration in od_router_expire_cb(). Also you can find how to open new connections in od_frontend_attach().

atrauzzi commented 4 years ago

I don't think I want to get into maintaining a fork. Is this not something that could be added as a feature?

x4m commented 4 years ago

Sure, we want this feature.

atrauzzi commented 4 years ago

Nice. Well, unfortunately I'm not in any way competent with C, so I doubt you'd even want me making this! :sweat_smile:

At least this issue is open here now and if you or someone else who is familiar enough can, they can add it.