Back to Blog
Lesson 26 of the Redis: Redis Essentials & Data Types course
DatabasesAugust 13, 20264 min read

Monitoring Redis Performance: Using INFO for Health and Metrics

Master Redis performance monitoring using the INFO command. Learn to interpret critical health metrics and identify bottlenecks to keep your cache stable.

redismonitoringperformancedatabaseinfrastructurebackend
Close-up of business charts with magnifying glass highlighting data insights.

Previously in this course, we covered Understanding Redis Persistence, which explored how to ensure data durability. Now that your data is safe, this lesson focuses on keeping your Redis instance running efficiently by mastering performance monitoring.

In the world of high-performance databases, guessing is not a strategy. You need empirical data to understand how your cache behaves under load. Because Redis is an in-memory store, its performance is highly sensitive to workload patterns, and monitoring is your primary tool for catching issues like long-running commands or memory pressure before they cause an outage.

The Power of the INFO Command

The INFO command is your primary diagnostic tool. When you run INFO in your redis-cli (which we introduced in Mastering the Redis CLI), Redis returns a comprehensive report structured in sections.

To get started, open your terminal and connect to your instance:

Bash
redis-cli
127.0.0.1:6379> INFO

You will see a wall of text. While overwhelming at first, you only need to focus on a few key sections to maintain a healthy service:

  • Server: General information about the Redis version and process ID.
  • Clients: Connection counts and blocked clients.
  • Memory: RAM usage and fragmentation metrics.
  • CPU: CPU consumption by the Redis process.
  • Stats: Command throughput, cache hits/misses, and expired keys.

Interpreting Key Performance Metrics

Not all metrics are created equal. As a practitioner, focus on these "Golden Signals" of Redis health:

MetricSectionWhat it tells you
connected_clientsClientsHow many applications are connected to your cache.
used_memory_humanMemoryTotal RAM consumed by your dataset.
instantaneous_ops_per_secStatsThe current throughput of your server.
keyspace_hits / missesStatsThe effectiveness of your Building a Simple API Response Cache logic.
latest_fork_usecPersistenceHow long the server was blocked during background saves.

A high instantaneous_ops_per_sec is great, but if keyspace_hits is low, your application is putting unnecessary strain on your primary database. If latest_fork_usec is high (in microseconds), your persistence process is causing latency spikes for your users.

Identifying Bottlenecks

Rows of wine bottles on a production line in an industrial setting.

Monitoring is only useful if you know what to look for when things go wrong. Here are the three most common bottlenecks I encounter in production:

1. The "Slow Command" Problem

Redis is single-threaded. If you run a command that takes 100ms, nothing else can happen for those 100ms. To find these culprits, use the SLOWLOG command:

Bash
# Get the last 10 slow commands
SLOWLOG GET 10

If you see keys being fetched with KEYS * or large lists being processed, you've found your performance killer.

2. Memory Fragmentation

If mem_fragmentation_ratio is significantly higher than 1.5, your OS is struggling to allocate memory efficiently for Redis. This often happens if you frequently update keys with changing sizes.

3. Connection Exhaustion

If connected_clients is consistently near your server's maxclients limit, your application will start throwing "Connection Refused" errors. This usually indicates that your application isn't closing connections properly or needs a connection pool (which we will cover later in this course).

Hands-on Exercise

  1. Connect to your local Redis instance via redis-cli.
  2. Run INFO stats to see your current keyspace_hits and keyspace_misses.
  3. Perform a few SET and GET operations using your Node.js project from earlier lessons.
  4. Run INFO stats again and observe how the total_commands_processed and keyspace_hits have changed.
  5. If you have a long-running process, run SLOWLOG GET to see if any commands were flagged as slow.

Common Pitfalls

Close-up of a triangular warning sign indicating a slippery surface, fixed to a wooden post.

  • Running INFO too often: While INFO is cheap, don't poll it every 10ms in production. Once every 5–10 seconds is sufficient for standard monitoring.
  • Ignoring the Cache Miss Rate: A low hit rate often means your TTLs are too short, or your cache-aside logic needs adjustment.
  • Misinterpreting CPU: Redis uses one CPU core for command execution. If you see 100% usage on one core, you have reached the vertical scaling limit of that instance.

Frequently Asked Questions

Can I monitor Redis without the CLI? Yes, most production environments use tools like Prometheus with the redis_exporter to visualize these metrics in Grafana dashboards.

What is a "good" latency for Redis? For local network operations, you should aim for sub-millisecond latency. Anything consistently above 1–2ms indicates a bottleneck.

Does INFO block other commands? No, INFO is an O(1) or O(N) operation depending on the section, but it is very fast and safe to run in production.

Recap

Team members presenting a project in a modern office setting with a focus on collaboration.

Monitoring Redis is about observing the balance between throughput, memory usage, and latency. By using the INFO command to track instantaneous_ops_per_sec and keyspace_hits, you gain visibility into your application's data access patterns. Remember: keep an eye on your SLOWLOG to ensure no expensive operations are blocking your event loop.

Up next: We will dive deeper into Memory Management Strategies, where we'll learn how to configure maxmemory and choose the right eviction policies to prevent your cache from crashing under pressure.

Similar Posts