0

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). How can I understand the difference between these two? Who should I trust for the amount of the connection?

halfer
  • 19,824
  • 17
  • 99
  • 186
James Xu
  • 115
  • 1
  • 12

1 Answers1

0

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

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

And...

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.

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: Number of client connections (excluding connections from replicas)

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

A Friend
  • 1,420
  • 17
  • 22
  • Thanks. But the thing is we are not seeing client_list summary amout is equal to total connected_clients. That is the problem. Which one is the truth. what is the difference of these two underlying in Redis? – James Xu Nov 15 '19 at 01:47
  • @JamesXu So when you count the clients in `CLIENT INFO` and subtract those that are replicas or slaves, the number you see is different than `connected_clients` in `INFO clients`? – LeoMurillo Jan 25 '20 at 04:05