“redis客户端列表"有什么区别?使用“来自信息的连接客户端" [英] What is the difference of "redis client list" with "connected client from info"

查看:76
本文介绍了“redis客户端列表"有什么区别?使用“来自信息的连接客户端"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am checking the actually connected clients from Redis. Which one should tell me the truth? I know "redis-cli client list" can give me more info, However, The total sum of this is different from the value in connected clients in (redis-cli info). Can someone help me to understand the difference between these two? Who should I trust for the amount of the connection?

非常感谢.

推荐答案

直接取自 Redis Docs,这里这里,区别如下:

Taken directly from the Redis Docs, here and here, these are the differences:

CLIENT LIST 命令返回有关以人类可读的格式提供客户端连接服务器.

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

还有……

INFO 命令返回有关服务器的信息和统计信息以一种易于计算机解析且易于阅读的格式人类.

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 命令的文档中所述的副本,否则两个命令都应告诉您相同数量的连接...

However, to answer your question, both commands should tell you the same number of connections unless the connection is a replica as stated in the docs for the INFO command...

connected_clients:客户端连接数(不包括连接数)来自复制品)

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

CLIENT LIST 是您应该依赖的关于您的客户/连接的关键数据

CLIENT LIST is what you should be relying on for key data about your clients/connections

这篇关于“redis客户端列表"有什么区别?使用“来自信息的连接客户端"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆