Skip to content

Commands for Redis clients

homepage-banner

client list

client list

id=4 addr=127.0.0.1:49148 fd=8 name= age=1 idle=1 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=26 qbuf-free=32742 argv-mem=10 obl=0 oll=0 omem=0 tot-mem=61466 events=r cmd=client user=default
  • id: unique identifier for the client
  • addr: ip:port
  • fd: socket fd, -1 indicates an internal client
  • name: client name
  • input buffer qbuf/qbuf-free: total and remaining buffer allocated for the client, dynamically adjusted, cannot exceed 1G, client will be closed if exceeded; this buffer is not controlled by maxmemory, large keys or blocking will quickly occupy this area
  • output buffer olb/oll/omem: stores command result and returns to client, can be set by client-output-buffer-limit, also not controlled by maxmemory; olb: fixed buffer length, oll: dynamic buffer length, omem: number of bytes used
client type hard_limit soft_limit soft_seconds

client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 4096mb 4096mb 1800
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
  • client age and idle state age/idle: client connection/idle time
  • client type flags:
  • events: file descriptor events r/w
  • cmd: last command
N normal client
M master
S slave
O monitor
x transaction
b blocking
u unblocking
c close connection after complete reply

client Name

client setName xxx
client getName

client pause

client pause timeout (ms)

info client

info client

# Clients
connected_clients:1
client_recent_max_input_buffer:8
client_recent_max_output_buffer:0
blocked_clients:0
tracking_clients:0
clients_in_timeout_table:0

info stats

info stats

# Stats
total_connections_received:1
total_commands_processed:0
instantaneous_ops_per_sec:0
total_net_input_bytes:25
total_net_output_bytes:0
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
expired_stale_perc:0.00
expired_time_cap_reached_count:0
expire_cycle_cpu_milliseconds:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
tracking_total_keys:0
tracking_total_items:0
tracking_total_prefixes:0
unexpected_error_replies:0
total_reads_processed:1
total_writes_processed:0
io_threaded_reads_processed:0
io_threaded_writes_processed:0

maxclients

config get maxclients
config set maxclients 500

client configuration

timeout: default 0
maxclients: configurable
tcp-keepalive: default 0, can be set to 60 to have redis check TCP connection every 60s to close dead connections
tcp-backlog: queue for accepting connections after TCP handshake, influenced by operating system `/proc/sys/net/core/somaxconn`

client exception

  • Improper client connection pool settings
  • Client read/write timeout: timeout set too short/long query/redis blocking/network
  • Client connection timeout: connection timeout set too short/tcp-backlog full/network
  • LOADING Redis is loading the dataset in memory
  • OOM command not allowed when used memory > maxmemory
  • Client connection count: ERR max number of clients reached
Feedback







Disclaimer
  • Welcome to visit the knowledge base of SRE and DevOps!
  • License under CC BY-NC 4.0
  • Made with Material for MkDocs and improve writing by generative AI tools
  • Copyright issue feedback me#imzye.com, replace # with @