Lists open connections.
CLIENT
LIST
[TYPE
<NORMAL
|
MASTER
|
REPLICA
|
PUBSUB
>]
[ID
client-id
[client-id…]]
The CLIENT LIST
command returns information and
statistics about the client connections server in a mostly human
readable format.
You can use one of the optional subcommands to filter the list. The
TYPE type
subcommand filters the list by clients’ type,
where type is one of normal
, master
,
replica
, and pubsub
. Note that clients blocked
by the MONITOR
command belong to the normal
class.
The ID
filter only returns entries for clients with IDs
matching the client-id
arguments.
Here is the meaning of the fields:
id
: a unique 64-bit client IDaddr
: address/port of the clientladdr
: address/port of local address client connected
to (bind address)fd
: file descriptor corresponding to the socketname
: the name set by the client with
CLIENT SETNAME
age
: total duration of the connection in secondsidle
: idle time of the connection in secondsflags
: client flags (see below)db
: current database IDsub
: number of channel subscriptionspsub
: number of pattern matching subscriptionsssub
: number of shard channel subscriptions.multi
: number of commands in a MULTI/EXEC contextwatch
: number of keys this client is currently
watching. Added in Valkey 8.0qbuf
: query buffer length (0 means no query
pending)qbuf-free
: free space of the query buffer (0 means the
buffer is full)argv-mem
: incomplete arguments for the next command
(already extracted from query buffer)multi-mem
: memory is used up by buffered multi
commands.obl
: output buffer lengtholl
: output list length (replies are queued in this
list when the buffer is full)omem
: output buffer memory usagetot-mem
: total memory consumed by this client in its
various buffersevents
: file descriptor events (see below)cmd
: last command playeduser
: the authenticated username of the clientredir
: client id of current client tracking
redirectionresp
: client RESP protocol version.lib-name
: The client library name as set by
CLIENT SETINFO
lib-version
: The client library version as set by
CLIENT SETINFO
tot-net-in
: Total network input bytes read from this
client. Added in Valkey 8.0tot-net-out
: Total network output bytes sent to this
client. Added in Valkey 8.0tot-cmds
: Total count of commands this client executed.
Added in Valkey 8.0The client flags can be a combination of:
A: connection to be closed ASAP
b: the client is waiting in a blocking operation
c: connection to be closed after writing entire reply
d: a watched keys has been modified - EXEC will fail
e: the client is excluded from the client eviction mechanism
i: the client is waiting for a VM I/O (deprecated)
M: the client is a primary
N: no specific flag set
O: the client is a client in MONITOR mode
P: the client is a Pub/Sub subscriber
r: the client is in readonly mode against a cluster node
S: the client is a replica node connection to this instance
u: the client is unblocked
U: the client is connected via a Unix domain socket
x: the client is in a MULTI/EXEC context
t: the client enabled keys tracking in order to perform client side caching
T: the client will not touch the LRU/LFU of the keys it accesses
R: the client tracking target client is invalid
B: the client enabled broadcast tracking mode
I: the client is an import source
The file descriptor events can be:
r: the client socket is readable (event loop)
w: the client socket is writable (event loop)
Bulk string reply: information and statistics about client connections.
O(N) where N is the number of client connections
@admin @connection @dangerous @slow
New fields are regularly added for debugging purpose. Some could be removed in the future. A version safe Valkey client using this command should parse the output accordingly (i.e. handling gracefully missing fields, skipping unknown fields).
id
field.TYPE
filter.user
field.argv-mem
, tot-mem
,
laddr
and redir
fields and the optional
ID
filter.resp
, multi-mem
,
rbs
and rbp
fields.ssub
field.master
TYPE
with
primary
. master
still supported for backward
compatibility.AUTH, CLIENT, CLIENT CACHING, CLIENT CAPA, CLIENT GETNAME, CLIENT GETREDIR, CLIENT HELP, CLIENT ID, CLIENT INFO, CLIENT KILL, CLIENT NO-EVICT, CLIENT NO-TOUCH, CLIENT PAUSE, CLIENT REPLY, CLIENT SETINFO, CLIENT SETNAME, CLIENT TRACKING, CLIENT TRACKINGINFO, CLIENT UNBLOCK, CLIENT UNPAUSE, ECHO, HELLO, PING, RESET, SELECT.