Skip to content

Building 70 Projects ranging from beginner to advanced so anyone can — learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company 👇

1.5 KB
Raw Blame
# ©AngelaMos | 2026
# redis.conf
#
# Production Redis 7.4 server configuration with security
# hardening
#
# Binds to all interfaces in protected mode. Disables
# dangerous commands (FLUSHALL, FLUSHDB, CONFIG, SHUTDOWN,
# MONITOR, DEBUG, SLAVEOF, MIGRATE) via rename-command.
# Enables AOF persistence with everysec fsync and RDB
# snapshots at 900/1, 300/10, 60/10000 intervals. Sets
# 2GB maxmemory with allkeys-lru eviction, 10000 max
# clients, 4 I/O threads with read offloading, TCP backlog
# 2048, 300s keepalive, slowlog at 10ms, latency monitor
# at 100ms, active defrag (5-20% thresholds), and lazyfree
# for eviction, expiry, and server-del. Connects to
# compose.yml

bind 0.0.0.0

protected-mode yes

rename-command FLUSHALL ""
rename-command FLUSHDB ""
rename-command CONFIG ""
rename-command SHUTDOWN ""
rename-command MONITOR ""
rename-command DEBUG ""
rename-command SLAVEOF ""
rename-command MIGRATE ""

loglevel notice

slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 100

appendonly yes
appendfsync everysec

save 900 1
save 300 10
save 60 10000

maxmemory 2gb

maxmemory-policy allkeys-lru

maxclients 10000
tracking-table-max-keys 1000000

port 6379

io-threads 4
io-threads-do-reads yes

tcp-backlog 2048
timeout 0
tcp-keepalive 300

activedefrag yes
active-defrag-ignore-bytes 25mb
active-defrag-threshold-lower 5
active-defrag-threshold-upper 20
active-defrag-cycle-min 1
active-defrag-cycle-max 75

lazyfree-lazy-eviction yes
lazyfree-lazy-expire yes
lazyfree-lazy-server-del yes
replica-lazy-flush yes

jemalloc-bg-thread yes