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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/dani-garcia/vaultwarden/pull/6166
**Author:** [@Samoth69](https://github.com/Samoth69)
**Created:** 8/10/2025
**Status:** ✅ Merged
**Merged:** 8/25/2025
**Merged by:** [@dani-garcia](https://github.com/dani-garcia)
**Base:** `main` ← **Head:** `main`
---
### 📝 Commits (4)
- [`c140e0e`](https://github.com/dani-garcia/vaultwarden/commit/c140e0e2ac6585588f271e8b314f099f59886f0b) Add min_idle and idle_timeout to database pool
- [`5964baa`](https://github.com/dani-garcia/vaultwarden/commit/5964baa72c31fa15519a55a69e1bce027ffdf9a7) Merge remote-tracking branch 'origin/main'
- [`aa496c4`](https://github.com/dani-garcia/vaultwarden/commit/aa496c45c15662e092ef3d2de2cf01adfd359ce1) Merge branch 'main' into main
- [`5e60f1b`](https://github.com/dani-garcia/vaultwarden/commit/5e60f1b7e0a95832cb7486e950d0664a270432b2) Update src/config.rs
### 📊 Changes
**2 files changed** (+9 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `src/config.rs` (+7 -1)
📝 `src/db/mod.rs` (+2 -0)
</details>
### 📄 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_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.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.