Skip to content

Commit c74fc53

Browse files
authored
Merge pull request #988 from Classic298/dev
2 parents e868922 + e1df1b1 commit c74fc53

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

docs/getting-started/env-configuration.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5553,11 +5553,19 @@ To use SQLCipher with existing data, you must either start fresh (with users exp
55535553
- Default: `None`
55545554
- Description: Specifies the pooling strategy and size of the database pool. By default SQLAlchemy will automatically chose the proper pooling strategy for the selected database connection. A value of `0` disables pooling. A value larger `0` will set the pooling strategy to `QueuePool` and the pool size accordingly.
55555555

5556+
:::tip High-Concurrency Deployments
5557+
5558+
For deployments with many concurrent users, consider increasing both `DATABASE_POOL_SIZE` and `DATABASE_POOL_MAX_OVERFLOW`. A good starting point is `DATABASE_POOL_SIZE=15` and `DATABASE_POOL_MAX_OVERFLOW=20`.
5559+
5560+
**Important:** The combined total (`DATABASE_POOL_SIZE` + `DATABASE_POOL_MAX_OVERFLOW`) should remain well below your database server's `max_connections` limit. PostgreSQL defaults to 100 max connections, so keeping the combined total under 50-80 per Open WebUI instance is recommended to leave room for other clients and maintenance connections.
5561+
5562+
:::
5563+
55565564
#### `DATABASE_POOL_MAX_OVERFLOW`
55575565

55585566
- Type: `int`
55595567
- Default: `0`
5560-
- Description: Specifies the database pool max overflow.
5568+
- Description: Specifies the database pool max overflow. This allows additional connections beyond `DATABASE_POOL_SIZE` during traffic spikes.
55615569

55625570
:::info
55635571

docs/troubleshooting/multi-replica.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,31 @@ Refer to the **[Cloud Infrastructure Latency](/tutorials/tips/performance#%EF%B8
131131

132132
### 7. Optimizing Database Performance
133133

134-
For PostgreSQL deployments with adequate resources, enabling database session sharing can improve performance under high concurrency:
134+
For PostgreSQL deployments with adequate resources, consider these optimizations:
135+
136+
#### Database Session Sharing
137+
138+
Enabling session sharing can improve performance under high concurrency:
135139

136140
```bash
137141
DATABASE_ENABLE_SESSION_SHARING=true
138142
```
139143

140144
See [DATABASE_ENABLE_SESSION_SHARING](/getting-started/env-configuration#database_enable_session_sharing) for details.
141145

146+
#### Connection Pool Sizing
147+
148+
If you experience `QueuePool limit reached` errors or connection timeouts under high concurrency, increase the pool size:
149+
150+
```bash
151+
DATABASE_POOL_SIZE=15 (or higher)
152+
DATABASE_POOL_MAX_OVERFLOW=20 (or higher)
153+
```
154+
155+
**Important:** The combined total (`DATABASE_POOL_SIZE` + `DATABASE_POOL_MAX_OVERFLOW`) should remain well below your database's `max_connections` limit. PostgreSQL defaults to 100 max connections, so keep the combined total under 50-80 per Open WebUI instance to leave room for other clients and maintenance operations.
156+
157+
See [DATABASE_POOL_SIZE](/getting-started/env-configuration#database_pool_size) for details.
158+
142159
---
143160

144161
## Deployment Best Practices

docs/tutorials/tips/performance.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,15 @@ If you upgraded to v0.7.0 and experienced slow admin page loads, API timeouts, o
112112

113113
:::
114114

115+
### Connection Pool Sizing
116+
117+
For high-concurrency PostgreSQL deployments, the default connection pool settings may be insufficient. If you experience `QueuePool limit reached` errors or connection timeouts, increase the pool size:
118+
119+
- **Env Var**: `DATABASE_POOL_SIZE=15` (default: uses SQLAlchemy defaults)
120+
- **Env Var**: `DATABASE_POOL_MAX_OVERFLOW=20` (default: 0)
121+
122+
**Important:** The combined total (`DATABASE_POOL_SIZE` + `DATABASE_POOL_MAX_OVERFLOW`) should remain well below your database's `max_connections` limit. PostgreSQL defaults to 100 max connections, so keep the combined total under 50-80 per Open WebUI instance to leave room for other clients and maintenance operations.
123+
115124
### Vector Database (RAG)
116125
For multi-user setups, the choice of Vector DB matters.
117126

0 commit comments

Comments
 (0)