Databases 8 min read

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

Learn the essential Redis monitoring metrics—including performance, memory, activity, persistence, and error indicators—along with the commands and tools such as redis-cli, INFO, SLOWLOG, and redis-benchmark to collect, interpret, and act on these metrics for effective database operations.

dbaplus Community
dbaplus Community
dbaplus Community
Mastering Redis Monitoring: Key Metrics, Commands, and Performance Testing

Monitoring Metrics Overview

Redis provides a set of built‑in metrics that can be grouped into five categories: Performance, Memory, Basic Activity, Persistence, and Error. These metrics help operators understand the health, capacity, and reliability of a Redis instance.

Performance Metrics

Name: latency – Description: Time taken for Redis to respond to a request.

Name: instantaneous_ops_per_sec – Description: Average number of operations processed per second.

Name: hit_rate (calculated) – Description: Cache hit rate, derived from other counters.

Memory Metrics

Name: used_memory – Description: Total memory allocated by the allocator from the operating system.

Name: mem_fragmentation_ratio – Description: Ratio of memory fragmentation.

Name: evicted_keys – Description: Number of keys evicted because the maxmemory limit was reached.

Name: blocked_clients – Description: Clients blocked by BLPOP, BRPOP, or BRPOPLPUSH.

Basic Activity Metrics

Name: connected_clients – Description: Number of client connections.

Name: connected_slaves – Description: Number of slave connections.

Name: master_last_io_seconds_ago – Description: Seconds since the last master‑slave interaction.

Name: keyspace – Description: Total number of keys stored in the database.

Persistence Metrics

Name: rdb_last_save_time – Description: Unix timestamp of the last RDB snapshot saved to disk.

Name: rdb_changes_since_last_save – Description: Number of changes made to the dataset since the last RDB save.

Error Metrics

Name: rejected_connections – Description: Connections rejected because the maxclients limit was reached.

Name: keyspace_misses – Description: Number of key look‑ups that missed (no hit).

Name: master_link_down_since_seconds – Description: Duration, in seconds, that the master‑slave link has been down.

Monitoring Tools and Commands

redis-benchmark – synthetic benchmark tool.

redis-stat – real‑time statistics collector.

redis-faina – performance analysis utility.

redislive – live monitoring dashboard.

redis-cli – interactive command‑line client.

MONITOR – streams every command processed by the server.

SHOWLOG – displays server logs.

Slow‑query log management:

slowlog-log-slower-than 1000   # Log queries slower than 1000 µs</code>
<code>slowlog-max-len 100          # Keep up to 100 entries in the slowlog

Retrieving information with INFO (full dump or per‑section):

server – server environment parameters.

clients – client‑related information.

memory – memory usage statistics.

persistence – persistence status.

stats – general statistics.

replication – master‑slave replication details.

cpu – CPU usage.

cluster – cluster information.

keyspace – key count per database.

Example commands:

./redis-cli info stats | grep ops   # Show operations per second
# Interactive INFO usage
./redis-cli
> INFO server

Performance Monitoring

To measure raw throughput, use redis-cli info | grep ops or the benchmark tool:

redis-benchmark -c 100 -n 5000   # 100 concurrent connections, 5000 requests
Performance chart
Performance chart

Memory Monitoring

Key memory counters can be extracted with:

# Human‑readable memory usage
./redis-cli info | grep used_memory_human
# Blocked client count
./redis-cli info | grep blocked_clients
# Evicted keys count
./redis-cli info | grep evicted_keys
# Memory fragmentation ratio
./redis-cli info | grep mem_fragmentation_ratio
Memory usage chart
Memory usage chart

Basic Activity Monitoring

Client connections and replication status are visible via:

# Connected clients
./redis-cli info | grep connected_clients
# Connected slaves
./redis-cli info | grep connected_slaves

Persistence Monitoring

# Last RDB save timestamp
./redis-cli info | grep rdb_last_save_time
# Changes since last save
./redis-cli info | grep rdb_changes_since_last_save

Error Monitoring

Important error‑related counters:

# Rejected connections due to maxclients
./redis-cli info | grep rejected_connections
# Keyspace misses
./redis-cli info | grep keyspace_misses
# Master link down duration
./redis-cli info | grep master_link_down_since_seconds
# Replication backlog size
./redis-cli info | grep repl_backlog_size
# Partial sync errors
./redis-cli info | grep sync_partial_err

Redis Performance Testing Commands

redis-benchmark -c 100 -n 5000   # 100 connections, 5000 total requests

This command generates a synthetic load to evaluate throughput and latency under controlled conditions.

Benchmark result chart
Benchmark result chart
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

monitoringPerformanceredisPersistenceMemoryError
dbaplus Community
Written by

dbaplus Community

Enterprise-level professional community for Database, BigData, and AIOps. Daily original articles, weekly online tech talks, monthly offline salons, and quarterly XCOPS&DAMS conferences—delivered by industry experts.

0 followers
Reader feedback

How this landed with the community

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.