jdog
jdog

Reputation: 10759

How to tell what is connected to your Redis and blocking?

I have a redis cache and it keeps spiking to 100% usage threshold.

When I run CLIENT LIST

I get back this:

    redis 127.0.0.1:6379> CLIENT LIST
    addr=127.0.0.1:54210 fd=5 name= age=27325 idle=18609 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=incrby
    addr=127.0.0.1:54211 fd=6 name= age=27325 idle=18610 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=exec
    addr=127.0.0.1:54212 fd=7 name= age=27325 idle=24817 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=2916 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54213 fd=8 name= age=27325 idle=27325 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=2646 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54214 fd=9 name= age=27325 idle=27325 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=2156 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54215 fd=10 name= age=27325 idle=18609 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=2254 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54216 fd=11 name= age=27325 idle=21886 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=2842 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54217 fd=12 name= age=27325 idle=27325 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=441 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54218 fd=13 name= age=27325 idle=27325 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=441 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=blpop
    addr=127.0.0.1:54219 fd=14 name= age=27325 idle=27325 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=info
    addr=127.0.0.1:54220 fd=15 name= age=27325 idle=27325 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=info
    addr=127.0.0.1:54221 fd=16 name= age=27286 idle=18609 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=hset
    addr=127.0.0.1:54222 fd=17 name= age=27286 idle=18610 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=exec
    addr=127.0.0.1:54223 fd=18 name= age=27286 idle=18609 flags=N db=0 sub=1 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=subscribe
    addr=127.0.0.1:54302 fd=19 name= age=27 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

Why so many flag=b (client blocking)? How can I tell what these are and why blocking?

Upvotes: 1

Views: 2735

Answers (1)

for_stack
for_stack

Reputation: 22936

Why so many flag=b (client blocking)?

flags=b means that these clients are running blocking commands.

How can I tell what these are

In your case, these clients are sending BLPOP command to Redis, i.e. cmd=blpop

and why blocking?

BLPOP commands blocks the connection when there's no element in the given LIST. See the doc for details.

Upvotes: 3

Related Questions