[PR #6166] Make database connection pool dynamic #2455

Open
opened 2025-10-09 18:05:28 +03:00 by OVERLORD · 0 comments
Owner

Original Pull Request: https://github.com/dani-garcia/vaultwarden/pull/6166

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/dani-garcia/vaultwarden/pull/6166 **State:** closed **Merged:** Yes --- 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.
OVERLORD added the pull-request label 2025-10-09 18:05:28 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#2455