gpt4 book ai didi

redis - 如何判断什么连接到你的 Redis 和阻塞?

转载 作者:可可西里 更新时间:2023-11-01 11:11:30 26 4
gpt4 key购买 nike

我有一个 Redis 缓存,它不断飙升至 100% 的使用率阈值。

当我运行 CLIENT LIST

我回来了:

    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

为什么这么多flag=b(客户端阻塞)?我怎么知道这些是什么以及为什么要阻止?

最佳答案

Why so many flag=b (client blocking)?

flag=b 表示这些客户端正在运行阻塞命令。

How can I tell what these are

在您的情况下,这些客户端正在向 Redis 发送 BLPOP 命令,即 cmd=blpop

and why blocking?

当给定的 LIST 中没有元素时,

BLPOP 命令会阻止连接。查看doc了解详情。

关于redis - 如何判断什么连接到你的 Redis 和阻塞?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48313885/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com