我最近从 Booksleeve 迁移到 StackExchange.Redis。
出于监控目的,我需要使用 MONITOR命令。
在 wiki我读过
From the IServer instance, the Server commands are available
但我在 IServer
中找不到任何有关 MONITOR 的方法;在存储库中快速搜索后,即使定义了 RedisCommand.MONITOR
,该命令似乎也未映射。
那么,StackExchange.Redis 支持 MONITOR 命令吗?
最佳答案
由于多种原因,不提供对监视器的支持:
- 调用
monitor
是一条不归路;monitor
连接永远不能是任何除了monitor
连接 - 它肯定不能与多路复用器很好地配合(尽管我猜想是一个单独的连接可以使用) monitor
并不是普遍鼓励的做法 - 它具有影响力;当您确实使用它时,最好在尽可能靠近服务器的地方运行它(通常在服务器本身的终端中)- 通常应短期使用
但更重要的是,也许,我只是没有看到合适的用户案例或对此有要求。如果在某些情况下 monitor
有意义,我很乐意考虑添加某种支持。您想在这里用它做什么?
请注意您链接到的monitor
页面上的警告:
In this particular case, running a single MONITOR client can reduce the throughput by more than 50%. Running more MONITOR clients will reduce throughput even more.
关于redis - StackExchange.Redis 支持 MONITOR 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24671030/