Max Makarochkin
Max Makarochkin

Reputation: 79

Reading Redis Info

My laptop has only 8GB RAM, I tried to stress test my app, which uses Redis heavily. When I looked at INFO output I couldn't figure out how used memory can be 31.83GB. Rdb dump is only 300 mb.

# Memory
used_memory:34177666096
used_memory_human:31.83G
used_memory_rss:412901376
used_memory_peak:34175483600
used_memory_peak_human:31.83G
used_memory_lua:31744
mem_fragmentation_ratio:0.01
mem_allocator:libc

Questions:

Why Rdb dump is so small and used_memory_human is so big? How to identify actual memory usage (INFO shows something different)?

Upvotes: 2

Views: 243

Answers (1)

Pascal Le Merrer
Pascal Le Merrer

Reputation: 5981

Redis does not use the same representation of data in memory and on disk. Each one is optimized. The in memory representation is optimized for access speed, while the on-disk representation reduces disk space usage. So you can't compare the size of the file with the RAM used.

used_memory / used_memory_human is the memory that was allocated to Redis by libc. As it is much greater than used_memory_rss, which is the size as seen by the OS, it means your system is swapping, so you should expect some performance issues.

Upvotes: 5

Related Questions