running redis-server makes the system hang/slow due to lack of memory

13 views
Skip to first unread message

muneendra kumar

unread,
Jan 16, 2019, 7:24:03 AM1/16/19
to pmem
Hi ,
I am  running Redis on emulated NVDIMM.
And  i used the below link to build and  test the same.

And iam running the below commands for my test
./redis-server --nvm-maxcapacity 1 --nvm-dir /mnt/pmem0 --nvm-threshold 64

 while :; do echo 'Hit CTRL+C'; ./redis-benchmark -h 127.0.0.1 -p 6379 -t set,lpush -n 100000 -q  -d 4096  -r 10000  ; date;done

After sometime i observed that the server is slowing down due to lack of memory and when i run the top command i observed that redis-server is consuming memory.
Do i need to set any parameters while running redis-server to make sure that this doesn't happen again?

Regards,
Muneendra.

Peifeng Si

unread,
Jan 16, 2019, 9:01:20 AM1/16/19
to pmem
Hello Muneendra,

Thank you for trying out the pmem-redis.
For the current implementation of pmem-redis, it only stores the value whose size larger than the threshold into NVDIMM. In other words, all keys and management structures of redis-server ( e.g, the dict for all key-value pairs) are still kept in DRAM. Hence, you definitely will see DRAM consuming of redis in top command.

For the server slowing down issue, it may not be directly related to pmem-redis, can check if the system is doing swap ?

Thanks,
Peifeng


在 2019年1月16日星期三 UTC+8下午8:24:03,muneendra kumar写道:

muneendra kumar

unread,
Jan 16, 2019, 9:30:31 AM1/16/19
to Peifeng Si, pmem
Hi Peifeng,
Thanks for the info.
In my above commands i kept the threshold value 64 (  --nvm-threshold 64) while running server and while running benchmark test  i gave the option of -d 4096 
so thus it means the values larger than 4k are stored in NVDIMM ?
And the size of dict for all key-value pairs keeps increasing while i run the above benchmark command in a loop ?

Is my understanding correct?

Below is the o/p of the top command. 
And i have memory of 7GB and when the redis server consumes 48.6% of memory i.e 3.5 GB the response is slow as the amount of available memory is low
at that moment.

Tasks: 224 total,   2 running, 153 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.2 us, 13.4 sy,  0.0 ni, 42.6 id, 39.3 wa,  0.0 hi,  2.5 si,  0.0 st
KiB Mem :  7651616 total,   134112 free,  7232132 used,   285372 buff/cache
KiB Swap:        0 total,        0 free,        0 used.    20092 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
27150 root      20   0 4985796   3.5g  14916 D  17.1 48.6   0:54.45 redis-server
27226 root      20   0   20760   6736   1992 S  12.2  0.1   0:02.47 redis-benchmark

I will recheck  if the system is doing swap as suggested by you.
Regards,
Muneendra.

--
You received this message because you are subscribed to the Google Groups "pmem" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pmem+uns...@googlegroups.com.
To post to this group, send email to pm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pmem/831fe7eb-bf00-4479-bfc6-273266ba5fe5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages