Introduction
Memory usage analysis helps you understand how much memory your Redis server is using. This keeps your database fast and stable.
INFO memory
INFO memory
INFO memory
used_memory field in the INFO memory command represent in Redis?INFO memory outputINFO memory command shows various memory stats about Redis.used_memory meaningused_memory specifically shows how many bytes Redis is currently using in RAM.used_memory = current memory used [OK]INFO memory.MEMORY USAGE exists but returns usage for a single key, not overall memory info. The others are invalid commands.INFO memory to get memory stats [OK]used_memory:1048576 used_memory_peak:2097152 mem_fragmentation_ratio:1.5
mem_fragmentation_ratio value of 1.5 indicate?mem_fragmentation_ratioINFO memory and see used_memory_peak is lower than expected despite high used_memory. What is the likely cause?used_memory_peakused_memoryused_memory is higher, it means memory usage increased after peak was reset (likely after restart).mem_fragmentation_ratio is consistently above 2.0. What is the best action to reduce memory fragmentation?MEMORY PURGE triggers allocator to release unused memory and reduce fragmentation.MEMORY PURGE command to defragment memory -> Option AMEMORY PURGE to reduce fragmentation [OK]Pass the test and this pattern moves unknown