mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #15175] [CLOSED] [Perf] Default database pool size to 1 #62600
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/open-webui/open-webui/pull/15175
Author: @prene
Created: 6/20/2025
Status: ❌ Closed
Base:
dev← Head:default-database-pool-to-one📝 Commits (1)
975273cDefault database pooling to 1📊 Changes
1 file changed (+3 additions, -3 deletions)
View changed files
📝
backend/open_webui/env.py(+3 -3)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.https://github.com/open-webui/docs/pull/589
Changelog Entry
Default DATABASE_POOL_SIZE=1
Description
This PR defaults the database pooling setting to 1 instead of 0 for a better out-of-the-box experience, minimizing user frustration.
Why?
It seems that some users, especially those using non-local databases, see slow response times from the API. One reason is that DATABASE_POOL_SIZE must be manually set to something that is appropriate for the anticipated workload. However, defaulting DATABASE_POOL_SIZE to 0 (= disabling pooling all together) introduces an unnecessary bottleneck.
By changing the default to DATABASE_POOL_SIZE=1, we ensure that a single, persistent connection is established and then reused for subsequent requests, instead of disabling pooling (= opening new db connections for every request, which introduces a lot of overhead).
I argue that this change provides a much better out-of-the-box experience. While users are still encouraged to configure the database pool size based on their specific needs and expected workload to handle concurrent requests efficiently, defaulting to 1 removes a harmful and unnecessary performance bottleneck for all users, particularly those connecting to remote databases.
Changed
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.