What is Redis?
Redis (REmote DIctionary Server) is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. Redis has gained tremendous popularity because of stability, ease of configuration and high performance.
Redis is by design a single threaded application.This means that, most, if not all, operations are atomic. This simplifies both application programming and the Redis implementation.
In addition, Redis supports clustering out of the box. This allows most use cases to scale horizontally, a common requirement in todays applications.
As with most services, there are two main aspects of monitoring Redis, regardless if it is used as a cache, message broker or a persistent data store. The primary aspect is the server health it self, where Redis is running. The second aspect, is composed by the metrics and health indicators from the Redis database application.
INFO provides a little less than 100 metrics, all of which has a human readable name. The INFO command is enabled by default, and doesn't require any additional configuration to run.
The table below explains the most useful and interesting metrics.
|connected_clients||This is the number of connected clients. This also includes shell sessions. Make sure that your maxclients setting is set higher than this, and that you have sufficiently file descriptors for handling all your connections.|
|used_memory_human||This is the amount of memory Redis is consuming for your data, and should always be less than your total available RAM, or you maxmemory setting.|
|instantaneous_ops_per_sec||This is the number of operations per second that Redis is currently executing. A modern laptop should easily perform 70 000. NOTE: some operations demands more resources than others. In particular, one should thread carefully with SCAN, which is a common cause of performance degradation.|
|keyspace_hits||This is the number of successful key lookups. This number, together with keyspace_misses, can be used to calculate the hit rate.|
This is a overview over the number of key and
the number of keys with a expire time set for the
db0:keys=4422,expires=4418,avg_ttl=21840849Notice that this indicates that there are some keys which doesn't have an expire. This can be useful to check from time to time, to make sure you have set expiretime for all your keys, which is a good policy for a cache.
|client_longest_output_list||If this number is high, it means that a client has requested a query with a very large response, and is struggling to consuming it. This can lead to increase memory usage, and be the answer to some hard-to-debug memory problems.|
Monitoring Redis with monometric.io
With monometric.io you get access to hundreds of underlying server and operating system metrics, as well as an easy to install Redis plugin that enables you to make the most out of Redis metrics.
The Redis plugin for monometric.io will expose all INFO metrics, as well as useful aggregates of the status counters, enabling you to monitor such metrics as operations per second, connected clients and network usage.
The Redis plugin will also give you metrics for CPU and memory utilization by the Redis process.
Build a customized dashboard to monitor the metrics most relevant to you. Correlate Redis specific metrics with operating system, server and network interface metrics to get the perfect overview of your Redis server health and performance.