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?
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