w3resource

Redis Server: CLIENT LIST

Redis CLIENT LIST Command

Redis CLIENT LIST command is used to return information and statistics about the client connections server in a mostly human readable format.

Here are some common uses and scenarios for the "CLIENT LIST" command:

  • Client Monitoring: Provides a list of connected clients, useful for monitoring and managing active connections.
  • Troubleshooting: Helps in diagnosing connection issues by displaying client details such as IP address, port, and status.
  • Resource Management: Allows administrators to track and manage resource usage by viewing client information.
  • Security Auditing: Enhances security by identifying and auditing connected clients for unusual or unauthorized activity.
  • Performance Analysis: Assists in performance analysis by showing details about clients, such as commands being executed and connection duration.

Syntax:

Basic syntax of redis CLIENT LIST command is shown below:

CLIENT LIST  

Available since

2.4.0.

Return Value

Bulk string reply, a unique string.

  • One client connection per line (separated by LF)
  • Each line is composed of a succession of property=value fields separated by a space character.

Description of fields

  • id: a unique 64-bit client ID
  • addr: address/port of the client
  • fd: file descriptor corresponding to the socket
  • age: total duration of the connection in seconds
  • idle: idle time of the connection in seconds
  • flags: client flags (see below)
  • db: current database ID
  • sub: number of channel subscriptions
  • psub: number of pattern matching subscriptions
  • multi: number of commands in a MULTI/EXEC context
  • qbuf: query buffer length (0 means no query pending)
  • qbuf-free: free space of the query buffer (0 means the buffer is full)
  • obl: output buffer length
  • oll: output list length (replies are queued in this list when the buffer is full)
  • omem: output buffer memory usage
  • events: file descriptor events (see below)
  • cmd: the last command played

Return Value Type

String

Previous: CLIENT KILL
Next: CLIENT GETNAME



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/redis/redis-server-client-list.php