[PR #6166] [MERGED] Make database connection pool dynamic #36819

Closed
opened 2026-07-13 21:23:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 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: mainHead: main


📝 Commits (4)

  • c140e0e Add min_idle and idle_timeout to database pool
  • 5964baa Merge remote-tracking branch 'origin/main'
  • aa496c4 Merge branch 'main' into main
  • 5e60f1b Update 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_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>
GiteaMirror added the pull-request label 2026-07-13 21:23:06 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#36819