Make database connection pool dynamic #417

Closed
opened 2026-04-05 21:12:29 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Samoth69 on 8/10/2025

Hello,

I've notice that Vaultwarden always keep his database pool fully connected to the database. Since my instance of Vaultwarden has a light load this resulted in 10 database connections being almost always in idle.

This PR fix this by using min_idle and idle_timeout options of the database pool manager. This allow the app to keep only 2 sessions at minimum while allowing the pool to grow when there is more load.

*Originally created by @Samoth69 on 8/10/2025* Hello, I've notice that Vaultwarden always keep his database pool fully connected to the database. Since my instance of Vaultwarden has a light load this resulted in 10 database connections being almost always in idle. This PR fix this by using `min_idle` and `idle_timeout` options of the database pool manager. This allow the app to keep only 2 sessions at minimum while allowing the pool to grow when there is more load.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#417