-
Notifications
You must be signed in to change notification settings - Fork 744
Redis Memory Optimization
sripathikrishnan edited this page Apr 20, 2012
·
12 revisions
WORK IN PROGRESS
Redis keeps all its data in memory, and so it is important to optimize memory usage. This document explains several strategies to reduce memory overheads. This document builds up on the official memory optimization notes on redis.io, so you should read that document first.
Redis uses a special, memory-efficient encoding if a list, sorted set or hash contains few elements, or if the size of each element is less than a threshold.
The following directives control when this special encoding is used :
hash-max-zipmap-entries 64 (hash-max-ziplist-entries for Redis >= 2.6)
hash-max-zipmap-value 512 (hash-max-ziplist-value for Redis >= 2.6)
list-max-ziplist-entries 512
list-max-ziplist-value 64
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
How do you choose the best values for these parameters? Analyze your data.
TBD : Explain how memory analyzer can help identifying the right values for these parameters.