Skip to content

Commit 69f7470

Browse files
committed
Say plainly that raising the worker count is the wrong way to scale
The setting is documented as a last resort rather than an option alongside running more containers. Extra workers require everything extra replicas require, a client-server vector database, Redis, PostgreSQL and a single instance running migrations, and give none of what replicas give back: they share one container, so they share its memory limit and its fate, cannot be restarted one at a time and cannot be spread across machines. The warning sits on the variable's own entry, on the scaling guide where it was presented as a simpler alternative, and in the Redis guide beside the multi-worker example, since that is where someone reads the value and copies it.
1 parent f3a75fe commit 69f7470

3 files changed

Lines changed: 18 additions & 8 deletions

File tree

docs/getting-started/advanced-topics/scaling.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,20 @@ Use Kubernetes, Docker Swarm, or similar platforms to manage multiple replicas:
135135
- Set `ENABLE_DB_MIGRATIONS=false` on all replicas except one designated "primary" pod to prevent migration race conditions: see [Updates and Migrations](/troubleshooting/multi-replica#updates-and-migrations) for the safe procedure
136136
- Scale up/down by adjusting your replica count
137137

138-
### Option B: Multiple Workers per Container
138+
### Option B: Multiple Workers per Container (Last Resort)
139139

140-
For simpler setups (e.g., a single powerful server), increase `UVICORN_WORKERS`:
140+
On a single machine with no orchestrator at all, you can raise `UVICORN_WORKERS`:
141141

142142
```
143143
UVICORN_WORKERS=4
144144
```
145145

146-
This spawns multiple application processes inside a single container. You still need PostgreSQL and Redis when using this approach.
146+
:::warning This is the weakest way to scale
147+
148+
Prefer more containers even on one machine: Docker Compose runs replicas on a single host perfectly well, and gets you restarts one at a time and a per-container memory limit.
149+
150+
Extra workers cost you everything replicas cost, PostgreSQL, Redis and a client-server vector database are all still required, and return none of the benefit. They share one container, so they share its memory limit and die with it, and they cannot be spread across machines when one stops being enough.
147151

148-
:::info
149-
Container orchestration is generally preferred because it provides automatic restarts, rolling updates, and more granular resource control. Multiple workers inside a single container is a simpler alternative when orchestration isn't available.
150152
:::
151153

152154
### Offload HTTP Compression to the Load Balancer

docs/reference/env-configuration.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8246,11 +8246,13 @@ For most deployments, the default browser cookie-based session management is suf
82468246
- Default: `1`
82478247
- Description: Controls the number of worker processes that Uvicorn spawns to handle requests. Each worker runs its own instance of the application in a separate process.
82488248

8249-
:::info
8249+
:::warning Raising this is the worst way to scale Open WebUI
8250+
8251+
Leave it at `1` and add containers instead: more replicas in Docker Compose, or more pods through Kubernetes and the Helm chart, behind a load balancer.
82508252

8251-
When deploying in orchestrated environments like Kubernetes or using Helm charts, it's recommended to keep UVICORN_WORKERS set to 1. Container orchestration platforms already provide their own scaling mechanisms through pod replication, and using multiple workers inside containers can lead to resource allocation issues and complicate horizontal scaling strategies.
8253+
Extra workers demand everything extra replicas demand, a client-server vector database, Redis, PostgreSQL and a single instance running migrations, and give you none of what replicas give you in return. They all sit in one container, so they share its memory limit and its fate: the container is a single point of failure, cannot be restarted one worker at a time, and cannot be spread across machines.
82528254

8253-
If you use UVICORN_WORKERS, you also need to ensure that related environment variables for scalable multi-worker setups are set accordingly.
8255+
If you do raise it, set the related variables for multi-worker deployments as well; the rest of this entry covers what breaks without them.
82548256

82558257
:::
82568258

docs/tutorials/integrations/redis.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,12 @@ UVICORN_WORKERS="4" # Adjust based on your CPU cores
516516
REDIS_URL="redis://redis:6379/0" # Required when UVICORN_WORKERS > 1
517517
```
518518

519+
:::warning Prefer more containers over more workers
520+
521+
Raising `UVICORN_WORKERS` is the weakest way to scale Open WebUI. It requires the same external services as running several containers, Redis included, while leaving every worker inside one container that shares a single memory limit and fails as a unit. Run replicas with Docker Compose, Kubernetes or the Helm chart instead, keeping one worker each. See [Scaling Open WebUI](/getting-started/advanced-topics/scaling).
522+
523+
:::
524+
519525
:::danger
520526

521527
**Critical: Redis Required for UVICORN_WORKERS > 1**

0 commit comments

Comments
 (0)