From 5c3f2562c0a291465bf9cdcc62937824f770ba60 Mon Sep 17 00:00:00 2001 From: DrMelone <27028174+Classic298@users.noreply.github.com> Date: Tue, 3 Feb 2026 21:26:28 +0100 Subject: [PATCH] redis --- docs/getting-started/env-configuration.mdx | 8 +++- docs/tutorials/integrations/redis.md | 54 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/env-configuration.mdx b/docs/getting-started/env-configuration.mdx index 4a1b5f99..5237c198 100644 --- a/docs/getting-started/env-configuration.mdx +++ b/docs/getting-started/env-configuration.mdx @@ -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` diff --git a/docs/tutorials/integrations/redis.md b/docs/tutorials/integrations/redis.md index 47d49577..9db6a0b2 100644 --- a/docs/tutorials/integrations/redis.md +++ b/docs/tutorials/integrations/redis.md @@ -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: