Essential Redis Monitoring Metrics and Commands for Effective Operations
This guide details key Redis monitoring metrics—including performance, memory, activity, persistence, and error indicators—along with practical commands, configuration settings, and code snippets to help operators efficiently track and troubleshoot Redis instances.
Monitoring Metrics
Performance
Memory
Basic activity
Persistence
Error
Monitoring Methods
redis-benchmark
redis-stat
redis-faina
redislive
redis-cli
monitor
showlog
Key slowlog commands:
get(retrieve slow query log),
len(log entry count),
reset(clear log).
Relevant configuration:
slowlog-log-slower-than 1000 # threshold in microseconds
slowlog-max-len 100 # max number of log entriesThe
infocommand can fetch all or specific sections of server information.
server – server environment parameters
clients – client-related information
memory – memory statistics
persistence – persistence information
stats – general statistics
Replication – master‑slave replication details
CPU – CPU usage
cluster – cluster information
Keyspace – key‑value statistics
Example usage:
./redis-cli info | grep ops # operations per second
./redis-cli info stats | grep ops
./redis-cli info serverPerformance Monitoring
redis-cli info | grep ops # operations per secondMemory Monitoring
[root@CombCloud-2020110836 src]# ./redis-cli info | grep used | grep human
used_memory_human:2.99M # total memory allocated by allocator
used_memory_rss_human:8.04M # memory as seen by OS (top)
used_memory_peak_human:7.77M # peak memory consumption
used_memory_lua_human:37.00K # Lua engine memory usageBlocked clients caused by BLPOP/BRPOP/BRPOPLPUSH:
./redis-cli info | grep blocked_clients
blocked_clients:0Keys evicted due to max‑memory limit:
./redis-cli info | grep evicted_keys
evicted_keys:0Memory fragmentation ratio:
./redis-cli info | grep mem_fragmentation_ratio
mem_fragmentation_ratio:2.74Used memory:
./redis-cli info | grep used_memory:
used_memory:3133624Basic Activity Metrics
Number of connected clients indicates unexpected connections; use
client listto investigate.
./redis-cli info | grep connected_clients
connected_clients:1 ./redis-cli info | grep connected
connected_clients:1 # client connections
connected_slaves:1 # slave connectionsPersistence Metrics
./redis-cli info | grep rdb_last_save_time
rdb_last_save_time:1591876204 # timestamp of last RDB save
./redis-cli info | grep rdb_changes_since_last_save
rdb_changes_since_last_save:0 # changes since last saveError Metrics
High rejected connections indicate low
maxclientssetting.
./redis-cli info | grep connected_clients
connected_clients:1Keyspace misses (lookup failures):
./redis-cli info | grep keyspace
keyspace_misses:0Replication backlog size and partial sync errors help assess replication health:
./redis-cli info | grep repl_backlog_size
repl_backlog_size:1048576
./redis-cli info | grep sync_partial_err
sync_partial_err:1Redis Performance Test Commands
./redis-benchmark -c 100 -n 5000This runs a benchmark with 100 concurrent connections and 5,000 requests.
Efficient Ops
This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.