This commit is contained in:
DrMelone
2026-02-03 21:26:28 +01:00
parent 70892536f5
commit 5c3f2562c0
2 changed files with 61 additions and 1 deletions

View File

@@ -5804,7 +5804,7 @@ If you're running Open WebUI as a single instance with `UVICORN_WORKERS=1` (the
- Type: `bool`
- Default: `False`
- Description: Connect to a Redis Cluster instead of a single instance or using Redis Sentinels. If `True`, `REDIS_URL` must also be defined.
- Description: Connect to a Redis Cluster instead of a single instance or using Redis Sentinels. If `True`, `REDIS_URL` must also be defined. This mode is compatible with AWS Elasticache Serverless and other Redis Cluster implementations.
:::info
@@ -5812,6 +5812,12 @@ This option has no effect if `REDIS_SENTINEL_HOSTS` is defined.
:::
:::tip OpenTelemetry Support
Redis Cluster mode is fully compatible with OpenTelemetry instrumentation. When `ENABLE_OTEL` is enabled, Redis operations are properly traced regardless of whether you're using a single Redis instance or Redis Cluster mode.
:::
#### `REDIS_KEY_PREFIX`
- Type: `str`

View File

@@ -222,6 +222,41 @@ To enhance resilience during Sentinel failover—the window when a new master is
- **`REDIS_SENTINEL_MAX_RETRY_COUNT`**: Sets the maximum number of retries for Redis operations when using Sentinel (Default: `2`).
- **`REDIS_RECONNECT_DELAY`**: Adds an optional delay in **milliseconds** between retry attempts (e.g., `REDIS_RECONNECT_DELAY=500`). This prevents tight retry loops that may otherwise overwhelm the event loop or block the application before a new master is ready.
### Redis Cluster Mode
For deployments using Redis Cluster (including managed services like **AWS Elasticache Serverless**), enable cluster mode with the following configuration:
```bash
REDIS_URL="redis://your-cluster-endpoint:6379/0"
REDIS_CLUSTER="true"
```
:::info
**Key Configuration Notes**
- `REDIS_CLUSTER` enables cluster-aware connection handling
- The `REDIS_URL` should point to your cluster's configuration endpoint
- This option has no effect if `REDIS_SENTINEL_HOSTS` is defined (Sentinel takes precedence)
- When using cluster mode, the `REDIS_KEY_PREFIX` is automatically formatted as `{prefix}:` to ensure multi-key operations target the same hash slot
:::
#### AWS Elasticache Serverless
For AWS Elasticache Serverless deployments, use the following configuration:
```bash
REDIS_URL="rediss://your-elasticache-endpoint.serverless.use1.cache.amazonaws.com:6379/0"
REDIS_CLUSTER="true"
```
Note the `rediss://` scheme (with double 's') which enables TLS, required for Elasticache Serverless.
#### OpenTelemetry Support
Redis Cluster mode is fully compatible with OpenTelemetry instrumentation. When `ENABLE_OTEL` is enabled, Redis operations are properly traced regardless of whether you're using a single Redis instance, Redis Sentinel, or Redis Cluster mode.
### Complete Example Configuration
Here's a complete example showing all Redis-related environment variables:
@@ -245,6 +280,25 @@ REDIS_KEY_PREFIX="open-webui"
For Redis Sentinel deployments specifically, ensure `REDIS_SOCKET_CONNECT_TIMEOUT` is set to prevent application hangs during master failover.
#### Redis Cluster Mode Example
For Redis Cluster deployments (including AWS Elasticache Serverless):
```bash
# Required for Redis Cluster
REDIS_URL="rediss://your-cluster-endpoint:6379/0"
REDIS_CLUSTER="true"
# Required for websocket support
ENABLE_WEBSOCKET_SUPPORT="true"
WEBSOCKET_MANAGER="redis"
WEBSOCKET_REDIS_URL="rediss://your-cluster-endpoint:6379/0"
WEBSOCKET_REDIS_CLUSTER="true"
# Optional
REDIS_KEY_PREFIX="open-webui"
```
### Docker Run Example
When running Open WebUI using Docker, connect it to the same Docker network and include all necessary Redis variables: