mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-07-17 09:22:30 -05:00
[PR #6166] [MERGED] Make database connection pool dynamic #31339
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/dani-garcia/vaultwarden/pull/6166
Author: @Samoth69
Created: 8/10/2025
Status: ✅ Merged
Merged: 8/25/2025
Merged by: @dani-garcia
Base:
main← Head:main📝 Commits (4)
c140e0eAdd min_idle and idle_timeout to database pool5964baaMerge remote-tracking branch 'origin/main'aa496c4Merge branch 'main' into main5e60f1bUpdate src/config.rs📊 Changes
2 files changed (+9 additions, -1 deletions)
View changed files
📝
src/config.rs(+7 -1)📝
src/db/mod.rs(+2 -0)📄 Description
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_idleandidle_timeoutoptions 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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.