Hi,

We have a standalone Redis server that we use only for Redis pubsub.

We noticed a weird behaviour that after a very high usage, once usage is back to normal Redis starts using an increasing amount of memory.

It allocates about 7MB of memory every 10 seconds, and after some time releases it all at once.

127.0.0.1:6379> info memory
# Memory
used_memory:594230864
used_memory_human:566.70M
used_memory_rss:439468032
used_memory_peak:4567655040
used_memory_peak_human:4.25G
used_memory_lua:36864
mem_fragmentation_ratio:0.74
mem_allocator:jemalloc-3.6.0

Newrelic shows the following graphs:

CPU: screen shot 2016-02-08 at 00 37 26

Memory: screen shot 2016-02-08 at 00 36 59

Network: screen shot 2016-02-08 at 00 37 09

You can clearly see that in the beginning (Up until 10:20PM) there is high traffic on the server and memory is steady. Once traffic settles down the server memory usage increases.

Comment From: shaharmor

Is it possible that its somehow related to swap usage? It looks like this server had 44MB of swap usage throughout the whole time. (Not sure its related though)

Comment From: yoav-steinberg

Since this is a pubsub only sever, the only thing I can think of is that client connections are using up memory. This can be a result of the application side. Once way to check this is to run CLIENT LIST command (and INFO MEMORY) during the peak and non-peak hours and analyze the output. As this is an old ticket I'm marking it to be closed and I'll close it if there's no new activity. Also note this type of question should first be brought to one of the redis users forums or similar as there's no specific indication of a bug here (yet).