Redis Configuration Guide
Overview
This guide provides detailed information about configuring the Redis service for optimal performance and reliability in the Gradiant application.Basic Configuration
-
Set up environment variables in your
.envfile: -
Create a configuration object:
-
Initialize the service:
Configuration Options
Connection Settings
| Option | Description | Default | Recommended |
|---|---|---|---|
url | Redis connection URL | Required | - |
keyPrefix | Prefix for all keys | undefined | "app:" |
maxRetries | Maximum retry attempts | 3 | 3-5 |
retryDelay | Delay between retries (ms) | 1000 | 1000-5000 |
connectTimeout | Connection timeout (ms) | 5000 | 5000-10000 |
Connection Pool Settings
| Option | Description | Default | Recommended |
|---|---|---|---|
maxConnections | Maximum connections | 10 | 10-50 |
minConnections | Minimum connections | 2 | 2-5 |
healthCheckInterval | Health check interval (ms) | 30000 | 30000-60000 |