Stackexchange.Redis 为什么 ConnectionMultiplexer.Connect 会建立两个客户端连接? [英] Stackexchange.Redis why does ConnectionMultiplexer.Connect establishes two client connections?
问题描述
我很好奇为什么 ConnectionMultiplexer.Connect(options)
尝试将 2 个客户端而不是 1 个连接到 RedisDB?每次连接时,我都会看到 2 个额外的客户端连接到我的 RedisDB.
I am curious why ConnectionMultiplexer.Connect(options)
attempts to connect 2 clients to the RedisDB instead of 1? Each time I connect I see that 2 additional clients connect to my RedisDB.
推荐答案
因为 redis 需要单独的交互式命令连接而不是发布/订阅订阅.如果您不使用 pub/sub,您可以告诉选项禁用 SUBSCRIBE
命令,在这种情况下,我相信第二个连接没有建立.
Because redis requires separate connections for interactive commands versus pub/sub subscriptions. If you aren't using pub/sub, you could tell the options to disable the SUBSCRIBE
command, in which case I believe the second connection is not established.
这篇关于Stackexchange.Redis 为什么 ConnectionMultiplexer.Connect 会建立两个客户端连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!