How to check the number of open connections from a particular server to my Redis server
I have a shared Redis service and being used by multiple services. Because of a leak in one service, my Redis is crashing with too many open connections.
How to check what is the service creating too many connections?
1 Answer
5 years ago by Eleven
CLIENT LIST
command shows all open connections currently on your Redis server. It outputs something like following
127.0.0.1:6379> CLIENT LIST
id=416 addr=127.0.0.1:55104 fd=10 name= age=15896 idle=10805 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=client
id=872 addr=127.0.0.1:56023 fd=8 name= age=10871 idle=41 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=llen
id=2327 addr=127.0.0.1:59204 fd=11 name= age=10 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client
id=2328 addr=127.0.0.1:59205 fd=9 name= age=5 idle=5 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
127.0.0.1:6379>
There you can see the total open connections and from which IPs they are being made, using that you can find the service which may be leaking connections.
5 years ago by Karthik Divi