"redis client list" 和 "connected client from info" 有什么区别

What is the difference of "redis client list" with "connected client from info"

我正在检查来自 Redis 的实际连接的客户端。哪一个应该告诉我真相?我知道 "redis-cli client list" 可以给我更多信息,但是,总和与(redis-cli 信息)中已连接客户端的值不同。有人可以帮我理解这两者之间的区别吗?我应该相信谁的连接量?

非常感谢。

直接取自 Redis 文档,here and here,区别如下:

The CLIENT LIST command returns information and statistics about the client connections server in a mostly human readable format.

还有...

The INFO command returns information and statistics about the server in a format that is simple to parse by computers and easy to read by humans.

但是,为了回答您的问题,这两个命令应该告诉您相同数量的连接,除非该连接是 INFO 命令文档中所述的副本...

connected_clients: Number of client connections (excluding connections from replicas)

CLIENT LIST 是您应该依赖的有关 clients/connections

的关键数据