我正在使用Azure Redis的StackExchange.Redis nuget,但是,最近,我发现有太多连接,几乎所有连接都显示最后一个命令在“info”或 “取消订阅”。请参阅此处的“客户列表”摘录:
id = 698869 addr =<> fd = 5291 name =<> age = 1037 idle = 5 flags = N db = 0 sub = 0 psub = 0 multi = -1 qbuf = 0 qbuf-free = 0 obl = 0 oll = 0 omem = 0 ow = 0 owmem = 0 events = r cmd = info numops = 30 id = 698871 addr =<> fd = 20761 name =<> age = 1037 idle = 5 flags = N db = 0 sub = 1 psub = 0 multi = -1 qbuf = 0 qbuf-free = 0 obl = 0 oll = 0 omem = 0 ow = 0 owmem = 0 events = r cmd =取消订阅 numops = 23 id = 698879 addr =<> fd = 19839 name =<> age = 1037 idle = 5 flags = N db = 0 sub = 1 psub = 0 multi = -1 qbuf = 0 qbuf-free = 0 obl = 0 oll = 0 omem = 0 ow = 0 owmem = 0 events = r cmd =取消订阅 numops = 24
我需要帮助才能理解为什么这些“信息”和“取消订阅”命令会从nuget触发?我确信我自己不是从使用nuget的代码发送这些命令。 我的代码只通过nuget“GET”和“SET”。
答案 0 :(得分:0)
StackExchange.Redis定期发送" info replication"命令redis以获取有关服务器的详细信息。此外,默认情况下,StackExchange.Redis客户端在每个ConnectionMultiplexer.Connect()调用上打开两个与Redis的连接,一个调用用于来自客户端的交互命令,另一个连接用于pub / sub。如果您不使用pub / sub,则可以通过ConfigurationOptions()禁用subscribe命令来禁用第二个连接。