# Redis Configuration for Foxhunt HFT Trading System # Optimized for high-performance trading workloads #============================================================================ # NETWORK #============================================================================ bind 0.0.0.0 port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 300 #============================================================================ # GENERAL #============================================================================ daemonize no supervised no pidfile /var/run/redis.pid loglevel notice logfile "" databases 16 #============================================================================ # SECURITY #============================================================================ # Password will be set via command line arguments # requirepass will be set via Docker environment # Disable dangerous commands in production rename-command FLUSHDB "" rename-command FLUSHALL "" rename-command KEYS "" rename-command CONFIG "FOXHUNT_CONFIG_df8903bc" rename-command DEBUG "" rename-command EVAL "" # Enable protected mode protected-mode yes #============================================================================ # MEMORY MANAGEMENT #============================================================================ maxmemory 1gb maxmemory-policy allkeys-lru maxmemory-samples 5 #============================================================================ # PERSISTENCE - Balanced for performance and durability #============================================================================ # RDB Snapshots save 900 1 # Save if at least 1 key changed in 900 seconds save 300 10 # Save if at least 10 keys changed in 300 seconds save 60 10000 # Save if at least 10000 keys changed in 60 seconds stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb # AOF (Append Only File) for better durability appendonly yes appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes aof-use-rdb-preamble yes #============================================================================ # REPLICATION #============================================================================ # replica-serve-stale-data yes # replica-read-only yes # repl-diskless-sync no # repl-diskless-sync-delay 5 # replica-priority 100 #============================================================================ # SLOW LOG #============================================================================ slowlog-log-slower-than 10000 # 10ms threshold slowlog-max-len 128 #============================================================================ # LATENCY MONITORING #============================================================================ latency-monitor-threshold 100 #============================================================================ # EVENT NOTIFICATION #============================================================================ notify-keyspace-events "Ex" # Enable keyspace notifications for expired events #============================================================================ # ADVANCED CONFIG #============================================================================ hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-size -2 list-compress-depth 0 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit replica 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10 dynamic-hz yes aof-rewrite-incremental-fsync yes rdb-save-incremental-fsync yes #============================================================================ # HFT SPECIFIC OPTIMIZATIONS #============================================================================ # TCP socket configuration for low latency tcp-nodelay yes so-keepalive yes # Memory optimization maxclients 10000 timeout 0 # Background save frequency optimized for trading save 60 1000 # Disable some features that add latency lazyfree-lazy-eviction no lazyfree-lazy-expire no lazyfree-lazy-server-del no replica-lazy-flush no # Optimize for small objects (typical in HFT) hash-max-ziplist-entries 512 hash-max-ziplist-value 64 # Enable jemalloc optimizations jemalloc-bg-thread yes # Lua script cache lua-replicate-commands yes