Redis Configuration
The redis section configures the Redis connection used for the job queue.
Configuration
Section titled “Configuration”redis: addr: "localhost:6379" password: "" db: 0Options
Section titled “Options”Redis server address in host:port format.
| Property | Value |
|---|---|
| Type | string |
| Default | localhost:6379 |
| Environment | CS_REDIS_ADDR |
Examples:
# Local developmentaddr: "localhost:6379"
# Docker Composeaddr: "redis:6379"
# Custom portaddr: "redis.example.com:6380"password
Section titled “password”Redis password for authentication (if required).
| Property | Value |
|---|---|
| Type | string |
| Default | "" (no password) |
| Environment | CS_REDIS_PASSWORD |
Redis database number to use.
| Property | Value |
|---|---|
| Type | integer |
| Default | 0 |
| Environment | CS_REDIS_DB |
Environment Variables
Section titled “Environment Variables”CS_REDIS_ADDR="localhost:6379"CS_REDIS_PASSWORD="secret"CS_REDIS_DB="0"Redis Requirements
Section titled “Redis Requirements”Code Search requires Redis 6.0 or later.
Memory Configuration
Section titled “Memory Configuration”For most deployments, Redis default memory settings are sufficient. For large deployments:
# redis.confmaxmemory 256mbmaxmemory-policy noevictionImportant: Use noeviction policy to prevent job data loss.
How Redis is Used
Section titled “How Redis is Used”Code Search uses Redis for:
- Job Queue - Background jobs for indexing, syncing, and replace operations
- Job Results - Storing job completion status and errors
- Job Progress - Tracking progress of running jobs
Queue Keys
Section titled “Queue Keys”| Key Pattern | Purpose |
|---|---|
codesearch:jobs:queue | Job queue |
codesearch:job:* | Individual job data |
Troubleshooting
Section titled “Troubleshooting”Connection refused
Section titled “Connection refused”failed to connect to Redis: connection refused- Verify Redis is running:
redis-cli ping - Check host and port are correct
- Ensure Redis is bound to the correct interface
Authentication required
Section titled “Authentication required”NOAUTH Authentication requiredSet the password in config:
redis: addr: "redis:6379" password: "your-password"Or via environment variable:
CS_REDIS_PASSWORD="your-password"