📦 EqualifyEverything / equalify-reflow

📄 redis.conf · 160 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160# Equalify Reflow - Redis Configuration
# Optimized for message queuing and caching

# ============================================================================
# Network Configuration
# ============================================================================
# Accept connections from any host (within Docker network)
bind 0.0.0.0

# Port
port 6379

# TCP listen backlog
tcp-backlog 511

# TCP keepalive
tcp-keepalive 300

# ============================================================================
# General Configuration
# ============================================================================
# Run as daemon (no for Docker)
daemonize no

# Logging
loglevel notice
logfile ""

# Number of databases
databases 16

# ============================================================================
# Persistence Configuration
# ============================================================================
# Save the DB to disk
# Save after 900 seconds (15 min) if at least 1 key changed
save 900 1
# Save after 300 seconds (5 min) if at least 10 keys changed
save 300 10
# Save after 60 seconds if at least 10000 keys changed
save 60 10000

# Stop writes if save fails
stop-writes-on-bgsave-error yes

# Compress string objects using LZF
rdbcompression yes

# Checksum the RDB file
rdbchecksum yes

# RDB filename
dbfilename dump.rdb

# Working directory
dir /data

# ============================================================================
# Replication Configuration
# ============================================================================
# Disable replication by default (single instance for dev)
# Configure for production with Redis Cluster or Sentinel

# ============================================================================
# Security Configuration
# ============================================================================
# No password for development (use requirepass in production)
# requirepass your-strong-password-here

# Disable dangerous commands in production
# rename-command FLUSHDB ""
# rename-command FLUSHALL ""
# rename-command KEYS ""
# rename-command CONFIG ""

# ============================================================================
# Memory Management
# ============================================================================
# Maximum memory (set via environment variable in production)
# maxmemory 2gb

# Memory eviction policy - volatile-lru only evicts keys with TTLs set.
# All application keys have TTLs, so this avoids evicting non-expiring keys.
maxmemory-policy volatile-lru

# LRU precision
maxmemory-samples 5

# ============================================================================
# Append Only File (AOF) Configuration
# ============================================================================
# Enable AOF persistence for better durability
appendonly yes

# AOF filename
appendfilename "appendonly.aof"

# AOF fsync policy (everysec is good balance)
appendfsync everysec

# Rewrite AOF file when it grows by this percentage
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

# ============================================================================
# Slow Log Configuration
# ============================================================================
# Log queries slower than this (microseconds)
slowlog-log-slower-than 10000

# Maximum slow log entries
slowlog-max-len 128

# ============================================================================
# Advanced Configuration
# ============================================================================
# Hash settings
hash-max-ziplist-entries 512
hash-max-ziplist-value 64

# List settings
list-max-ziplist-size -2
list-compress-depth 0

# Set settings
set-max-intset-entries 512

# Sorted set settings
zset-max-ziplist-entries 128
zset-max-ziplist-value 64

# HyperLogLog sparse representation bytes limit
hll-sparse-max-bytes 3000

# Streams settings
stream-node-max-bytes 4096
stream-node-max-entries 100

# Active rehashing
activerehashing yes

# 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

# Frequency for automatic background tasks
hz 10

# Enable active defragmentation
activedefrag yes

# ============================================================================
# Queue-Specific Optimizations
# ============================================================================
# Optimize for blocking operations (BLPOP, BRPOP)
timeout 0

# Disable key notifications (not needed for our use case)
notify-keyspace-events ""