Operations 6 min read

Master Redis Monitoring: Key Metrics, Commands, and Performance Testing

This guide explains essential Redis monitoring metrics, the tools and commands for collecting performance, memory, activity, persistence, and error data, and shows how to use INFO, slowlog, and redis-benchmark to assess and improve database operations.

Efficient Ops
Efficient Ops
Efficient Ops
Master Redis Monitoring: Key Metrics, Commands, and Performance Testing

Monitoring Metrics

Performance

Memory

Basic activity

Persistence

Error

Monitoring Methods

redis-benchmark

redis-stat

redis-faina

redislive

redis-cli

monitor

showlog

Slow Log Commands

get – retrieve slow‑query log entries

len – get the number of slow‑query log entries

reset – clear the slow‑query log

Slow Log Configuration

<code>slowlog-log-slower-than 1000  # threshold in microseconds
slowlog-max-len 100           # maximum number of log entries</code>

INFO Command Overview

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‑space statistics

Using INFO

<code>./redis-cli info | grep <section>
# Example: ./redis-cli info stats | grep ops</code>

Performance Monitoring

<code>redis-cli info | grep ops   # operations per second</code>

Memory Monitoring

<code>./redis-cli info | grep used_memory_human
used_memory_human:2.99M          # total memory allocated by allocator
used_memory_rss_human:8.04M      # memory seen by OS (top)
used_memory_peak_human:7.77M     # peak memory consumption
used_memory_lua_human:37.00K    # Lua engine memory usage</code>

Basic Activity Metrics

<code>./redis-cli info | grep connected_clients
connected_clients:1            # number of client connections
connected_slaves:1              # number of slave connections</code>

Persistence Metrics

<code>./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 save</code>

Error Metrics

<code># Connections rejected due to maxclients limit
# (increase maxclients if the number is high)
# Keyspace misses (lookup failures)
keyspace_misses:0
# Replication backlog size
repl_backlog_size:1048576
# Partial sync errors
sync_partial_err:1</code>

Redis Performance Test

<code>./redis-benchmark -c 100 -n 5000   # 100 clients, 5000 requests</code>
Redis benchmark result
Redis benchmark result

Source: https://blog.51cto.com/yht1990/2503819

monitoringperformanceDatabaseRedismetricsOps
Efficient Ops
Written by

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.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.