# Redis Configuration for Graphiti MCP Server
# Optimized for persistent queue storage with crash recovery
# =============================================================================
# PERSISTENCE CONFIGURATION
# =============================================================================
# Enable AOF (Append-Only File) persistence
# This logs every write operation, providing excellent durability
appendonly yes
# AOF file name
appendfilename "appendonly.aof"
# AOF fsync policy:
# - always: fsync after every write (slowest, safest)
# - everysec: fsync every second (good balance) [RECOMMENDED]
# - no: let OS decide when to fsync (fastest, least safe)
appendfsync everysec
# Don't fsync during AOF rewrite (better performance, slightly less safe)
no-appendfsync-on-rewrite no
# AOF rewrite triggers
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
# AOF loading: Continue if there are truncated AOF entries
aof-load-truncated yes
# Use RDB preamble in AOF file for faster loading
aof-use-rdb-preamble yes
# =============================================================================
# RDB SNAPSHOT PERSISTENCE (BACKUP)
# =============================================================================
# RDB snapshots provide point-in-time backups
# Format: save <seconds> <changes>
# Save after 900 sec (15 min) if at least 1 key changed
save 900 1
# Save after 300 sec (5 min) if at least 10 keys changed
save 300 10
# Save after 60 sec if at least 10000 keys changed
save 60 10000
# RDB file name
dbfilename dump.rdb
# Directory where to store AOF and RDB files
dir /data
# Compress RDB files
rdbcompression yes
# RDB checksum
rdbchecksum yes
# Stop accepting writes if RDB fails
stop-writes-on-bgsave-error yes
# =============================================================================
# MEMORY MANAGEMENT
# =============================================================================
# Max memory (adjust based on your needs)
# For queue workloads, 256MB is usually sufficient
maxmemory 256mb
# Memory policy when maxmemory is reached
# noeviction: Return error when memory limit reached (safest for queues)
maxmemory-policy noeviction
# =============================================================================
# NETWORK CONFIGURATION
# =============================================================================
# Bind to all interfaces (Docker networks)
bind 0.0.0.0
# Disable protected mode (we're in a Docker network)
protected-mode no
# Default port
port 6379
# TCP keepalive (seconds)
tcp-keepalive 300
# =============================================================================
# SECURITY
# =============================================================================
# Disable dangerous commands in production
# Uncomment these in production environments:
# rename-command FLUSHDB ""
# rename-command FLUSHALL ""
# rename-command DEBUG ""
# rename-command CONFIG "CONFIG_SECRET_CMD"
# =============================================================================
# LOGGING
# =============================================================================
# Log level: debug, verbose, notice, warning
loglevel notice
# Log to stdout (Docker captures this)
logfile ""
# =============================================================================
# SLOW LOG
# =============================================================================
# Log queries slower than this (in microseconds)
slowlog-log-slower-than 10000
# Maximum number of slow log entries
slowlog-max-len 128
# =============================================================================
# CLIENT HANDLING
# =============================================================================
# Max clients
maxclients 100
# Client output buffer limits
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
# Timeout for idle clients (0 = disabled)
timeout 0