Memory is a critical resource for Redis to work. The memory used determines the total number of bytes allocated to Redis using its allocator (standard libc, jemalloc, or an alternative allocator such as tcmalloc).
You can collect all memory usage data for a Redis instance by running "information memory".
127.0.0.1:6379> info memory
Memory
used_memory: 1007280
used_memory_human: 983.67K
used_memory_rss: 2002944
used_memory_rss_human: 1.91M
used_memory_peak: 1008128
used_memory_peak_human: 984.50K
Sometimes, when Redis is configured without limiting maximum memory, memory usage will eventually reach system memory and the server will start throwing out of memory errors. In other cases, Redis is configured with a maximum memory limit, but without a search policy. This will result in the server not crowding out any keys, thereby preventing any writes until the memory is freed. The solution to such problems will be to configure Redis with maximum memory and some eviction policy. In this case, the server begins to supplant the keys using the eviction policy, as memory usage reaches its maximum.
RSS feed (resident set size) is the number of bytes allocated by the Redis operating system. If the ratio "memory_rss to" memory_used is greater than ~ 1.5, then this means memory fragmentation. Fragmented memory can be restored by restarting the server.
Learn more about tracking redis server here.
VISHAL KUMAWAT
source share