KeyDB icon indicating copy to clipboard operation
KeyDB copied to clipboard

[BUG] keydb server becomes unresponsive

Open brendanone opened this issue 3 years ago • 3 comments

Describe the bug We are using keyDB with opensips in a replicated cluster configuration. It works fine for a few days after which keydb-cli hangs.( no response or prompt after entering the command at linux CLI). Also remote requests fail to respond. Logging also stops working. (the symptoms occur on both servers in the cluster).

To reproduce Unknown. Seems to be load related. We have an identically configured but much less lightly loaded development instance which isnt impacted.

Expected behavior We should be able to update keydb via keydb-cli or over network.

Additional information

  • There are many FIFO Pipes open which I suspect is related to the issue.

[root@lxswat1002 c770190]# lsof |grep keydb | awk '{print $7}' |sort |uniq -c |sort -n |grep FIFO 122472 FIFO

  • From logs before it ceased logging. [root@lxswat1001 keydb]# grep "open files" /var/log/keydb/keydb-server.log-20230108 |grep "05 Jan" 2932708:2932723:S 05 Jan 2023 23:16:20.414 # Accepting client connection: accept: Too many open files 2932708:2932722:S 05 Jan 2023 23:16:20.414 # Accepting client connection: accept: Too many open files 2932708:2932723:S 05 Jan 2023 23:16:20.415 # Accepting client connection: accept: Too many open files 2932708:2932723:S 05 Jan 2023 23:16:20.415 # Accepting client connection: accept: Too many open files

config file attached. log file attached

[keydb-conf.zip](https://github.com/Snapchat/KeyDB/files/10369785/keydb-conf.zip keydb-server_log.zip

brendanone avatar Jan 09 '23 00:01 brendanone

Looks like we have the same error, we use sems and keydb in a replicated setup (even with a third "whitness" node). Both nodes with active "load" stopped working over night, process was running but nothing in the logs. Staging Envireonment doenst do that. First time it was running for almost 2 months, now this happend after less than 19 days after last restart.

EDIT 10:17 CET: Now the third "whitness node" without any load did the same (it was not restarted today morning). I could to the command from the initial post:

root@SERVER:/var/log/keydb# lsof |grep keydb | awk '{print $7}' |sort |uniq -c |sort -n |grep FIFO 121464 FIFO

qmex-mp avatar Jan 19 '23 07:01 qmex-mp

We have the same error again after 4 days uptime of keydb service now:

  • keydb-server -v

KeyDB server v=6.3.1 sha=ee16abf0:0 malloc=jemalloc-5.2.1 bits=64 build=dfd8f7282d6653b1

  • su keydb -s /bin/sh -c "ulimit -a"

core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 7754 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 100000 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 4096 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

  • lsof |grep keydb | awk '{print $7}' |sort |uniq -c |sort -n |grep FIFO

120192 FIFO

EDIT:

Add an systemd override to increase NOFILE to 100K on 2/3 nodes.

dbuelow avatar Jan 20 '23 09:01 dbuelow

We are seeing this as well, KeyDB 6.3.2 (d1dff8c2/0) 64 bit. lsof shows keydb-server having some 131k+ pipes open. This is a multi-master setup with three nodes running on CentOS 7.9. Things can be running smoothly for several days, but now it's less than a week since the last time.

EreMaijala avatar Feb 18 '23 06:02 EreMaijala