A connection pool can now be specified using env variables DATABASE_POOL_SIZE, DATABASE_POOL_MAX_OVERFLOW, DATABASE_POOL_RECYCLE and DATABASE_POOL_TIMEOUT
Description
this PR adds 4 env variables so that we can configure a pool for the database. It follows the documentation of SQLAlchemy here
in case the env variable DATABASE_POOL_SIZE is not configured or set to zero, then it falls back to no pool used at all like before. So it should not introduce any breaking change.
🔄 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/open-webui/open-webui/pull/5938
**Author:** [@Nowheresly](https://github.com/Nowheresly)
**Created:** 10/6/2024
**Status:** ✅ Merged
**Merged:** 10/6/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix5930`
---
### 📝 Commits (1)
- [`9706b76`](https://github.com/open-webui/open-webui/commit/9706b76b36b18e3b1a97de0a868716995c52bf0c) feat: db pool config #5935
### 📊 Changes
**3 files changed** (+66 additions, -2 deletions)
<details>
<summary>View changed files</summary>
📝 `.github/workflows/integration-test.yml` (+3 -0)
📝 `backend/open_webui/apps/webui/internal/db.py` (+24 -2)
📝 `backend/open_webui/env.py` (+39 -0)
</details>
### 📄 Description
# Pull Request Checklist
# Changelog Entry
A connection pool can now be specified using env variables DATABASE_POOL_SIZE, DATABASE_POOL_MAX_OVERFLOW, DATABASE_POOL_RECYCLE and DATABASE_POOL_TIMEOUT
### Description
- this PR adds 4 env variables so that we can configure a pool for the database. It follows the documentation of SQLAlchemy [here](https://docs.sqlalchemy.org/en/20/core/pooling.html#module-sqlalchemy.pool)
- in case the env variable DATABASE_POOL_SIZE is not configured or set to zero, then it falls back to no pool used at all like before. So it should not introduce any breaking change.
### Added
- The ability to configure a connection pool.
### Fixed
- It fixes #5935
---
<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/open-webui/open-webui/pull/5938
Author: @Nowheresly
Created: 10/6/2024
Status: ✅ Merged
Merged: 10/6/2024
Merged by: @tjbck
Base:
dev← Head:fix5930📝 Commits (1)
9706b76feat: db pool config #5935📊 Changes
3 files changed (+66 additions, -2 deletions)
View changed files
📝
.github/workflows/integration-test.yml(+3 -0)📝
backend/open_webui/apps/webui/internal/db.py(+24 -2)📝
backend/open_webui/env.py(+39 -0)📄 Description
Pull Request Checklist
Changelog Entry
A connection pool can now be specified using env variables DATABASE_POOL_SIZE, DATABASE_POOL_MAX_OVERFLOW, DATABASE_POOL_RECYCLE and DATABASE_POOL_TIMEOUT
Description
Added
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.