Redis Monitoring

Overview

Redis is a popular in-memory key / value data store. Known for its performance and simple onboarding, Redis has found uses across industries and use cases, including as a:

  • Database: As an alternative to a traditional disk-based database, Redis trades durability for speed, though asynchronous disk persistence is available. Redis offers a rich set of data primitives and an unusually extensive list of commands.
  • Message queue: Redis’s blocking list commands and low latency make it a good backend for a message broker service.
  • Memory cache: Configurable key eviction policies, including the popular Least Recently Used policy, make Redis a great choice as a cache server. Unlike a traditional cache, Redis also allows persistence to disk to improve reliability.

Metrics

Following metrics are used in Redis monitoring:

Performance Metrics:
  • Throughput (command/sec): Throughput is the number of operations processed by the database within a given period of interval.
  • SlowLog Queries: Number of slowlog queries.
  • SlowLog Queries percentage: Slowlog query in percentage with respect to total query.
Formula:
Total query in sample period = curr - prev [total_commands_processed]
Slow log query % = (Slow log query in sample period/ total query in sample period)* 100
  • Average SlowLog query time: Average slow log query time in microseconds.
Formula:
Avg Slow log Query Time (mc): Total Execution Query Time in sample period/Number of slow log queries
System Metrics
  • Used Memory (MB): Total number of bytes allocated by Redis
  • Fragmentation Ratio: Ratio of memory allocated by the operating system to memory requested by Redis. The operating system is responsible for allocating physical memory to each process. The operating system’s virtual memory manager handles the actual mapping, mediated by a memory allocator. If Redis instance has a memory footprint of 1GB, the memory allocator will first attempt to find a contiguous memory segment to store the data. If no contiguous segment is found, the allocator must divide the process’s data across segments, leading to increased memory overhead. A fragmentation ratio greater than 1 indicates fragmentation is occurring. A ratio in excess of 1.5 indicates excessive fragmentation, with your Redis instance consuming 150% of the physical memory it requested. A fragmentation ratio below 1 specifies that Redis needs more memory than is available on your system, which leads to swapping. Swapping to disk will cause significant increases in latency. Ideally, the operating system would allocate a contiguous segment in physical memory, with a fragmentation ratio equal to 1 or slightly greater.
  • System CPU Time (Sec): System CPU consumed by the Redis server.
  • User CPU Time (Sec): User CPU consumed by Redis server.
  • IO SYN Lag Time (Sec): Number of seconds since last transfer I/O during a SYNC operation.
Activity Metrics
  • Eviction Rate: Number of keys removed due to reaching the maxmemory limit.
  • Connected Client: Number of clients connected to Redis.
  • Expiration Rate: Total number of key expiration events per second.
  • Connected Slave: Number of slaves connected to current master instance.
  • Blocked clients: Number of clients pending on a blocking call.
  • Expired keys percentage: Expired keys in percentage with respect to total keys in databases.
Formula:
Expired Key % = ((E2 - E1)/(K1)) * 100
  • Evicted keys percentage: Evicted keys in percentage with respect to newly added keys in databases.
Formula:
New Evicted key in sample (Nk) = K2 - K1 + (Ex2 - Ex1) + (Ev2 - Ev2)
  • Server Role: Redis server role state. Role is 1 for Master and 0 for Slave.
  • Blocked Slave: Blocked slave in percentage with respect to total slaves.
Formula:
Blocked connections %= ((total slaves - connected slave)/total salves) * 100
Cache metrics
  • Key Space Misses/Sec: number of failed lookups of keys/ per second.
  • Key Space Hits/Sec: Number of attempts to find keys in redis database which do exist.
  • Total Keys: Total number of keys in database.
  • Hit Rate: Hit rate provide information about cache is being used effectively or not. A low hit rate means that clients are looking for keys that no longer exist. Following formula is used to hit rate:
Hit rate =  keyspace_hits / (keyspace_hits + keyspace_misses)
  • Rejected Connections: number of connections rejected due to hitting maximum client limit
  • Key Pending Expiration: Total number of key expiration events pending.
  • Cache Miss Rate percentage: Cache miss ratio is the percentage of failure reads out of all read operations in redis database.
Formula:                    
Key Misses Rate(Pct) =  ( keyspace_misses/(keyspace_misses+ keyspace_hits))*100
  • Rejected Connection Percentage: Rejected connections in percentage due to max connection limit is reached.
Formula:   
Rejected Connections (Rc) = curr rejected_connections - prev rejected_connections
Accepted Connection (Ac) = cur total_connections_received - prev  total_connections_received
Total Connections  (Tc) =  Rc + Ac
Rejected Connections % = (Rc/Tc) * 100 

Graph Description

RedisActivityStatsV2

Redis server Activity stats monitor measure health of redis server. It provides metrics related to evicted keys, expired keys, connected slaves, block clients.

SNo.MetricMetric Description
1Redis Evicted keys/secNumber of keys removed due to reaching the max memory limit.
2Redis Connected ClientsNumber of clients connected to Redis.
3Redis Expired keys/secTotal number of key expiration events per second.
4Redis Connected SlavesNumber of slaves connected to current master instance.
5Redis Blocked clientsNumber of clients pending on a blocking call.
6Redis Client Longest Output ListLongest output list among current client connections.
7Redis Client Biggest Input BufferBiggest input buffer among current client connections.
8Redis Expired keys (Pct)Expired keys in percentage with respect to total keys in databases.
9Redis Evicted keys (Pct)Evicted keys in percentage with respect to newly added keys in databases.
10Redis Server RoleRedis server role state. Role is 1 = Master,0 = Slave.
11Redis Blocked Slaves (Pct)Blocked slave in percentage with respect to total slaves.

RedisBDBSStats

Redis server Databases stats provides metrics related to Average Latency, Egress Bytes, Ingress Bytes, Memory Fragmentation Ratio, Memory Size Lua, Total Request, Total Response and Used Memory etc.

SNo.MetricMetric Description
1Redis Average Latency (ms)Latency per read and write operation in milliseconds.
2Redis Average Other Latency (ms)Latency per other commands in milliseconds.
3Redis Connections/SecNumber of connections to the end point per second.
4Redis Egress Bytes/SecBytes leaving the router/switch via the egress interface per second.
5Redis Evicted Keys/SecNumber of evicted keys due to max memory limit.
6Redis Expired Keys/SecNumber of expired keys per sec. An expired keys is an object with expired TTL that was deleted from the database.
7Redis System Fork Duration (ms)Duration of the System fork operation in milliseconds.
8Redis User Fork Duration (ms)Duration of the user fork operation in milliseconds.
9Redis Ingress Bytes/SecBytes coming into the router/switch via the ingress interface per second.
10Redis Instantaneous Commands/SecNumber of commands processed per second.
11Redis Memory Fragmentation RatioThe ratio between the memory allocated by Redis and the memory as seen by the operating system.
12Redis Used Memory Lua (MB)Used memory in megabytes by the Lua engine.
13Redis Monitor Sessions CountNumber of monitor sessions.
14Redis Total KeysThe total number of keys in the database.
15Redis Total Request/SecTotal number of request received by the redis server per second.
16Redis Total Response/SecTotal number of response delivered by the redis server per second.
17Redis Read Requests/SecThe number of read requests per second.
18Redis Read Responses/SecThe number of read responses per second.
19Redis Write Request/SecNumber of write request per second.
20Redis Write Response/SecNumber of write response per second.
21Redis Other Requests/SecNumber of other requests per second.
22Redis Other Responses/SecNumber of other responses per second.
23Redis Read Hits/SecThe number of read operations successfully per second.
24Redis Read Misses/SecThe number of read operations failed per second.
25Redis Write Hits/SecThe number of write operations per second.
26Redis Write Misses/SecThe number of write operations failed per second.
27Redis Pubsub ChannelsGlobal number of pub/sub channels with client subscriptions.
28Redis Pubsub PatternsGlobal number of pub/sub pattern with client subscriptions.
29Redis Shard CPU System (Pct)System CPU utilization by the redis shard.
30Redis Shard CPU User (Pct)User CPU Utilization by the Redis shard.
31Redis Total Connections Received/SecTotal number of connections received by the server per second.
32Redis Used Memory (MB)Total number of Megabytes allocated by Redis.

RedisCacheStatsV2

Redis server cache stats monitor measure health of redis server cache. It provides metrics related to cache keyspace hits, keyspace miss, keyspace pending expiration etc.

SNo.MetricMetric Description
1Redis Key Space Missess/secNumber of attempts to find keys in redis database which do not exist.
2Redis Key Space Hits/secNumber of attempts to find keys in redis database which do exist.
3Redis Total Key SpacesTotal number of key in all database.
4Redis Cache Hit Rate (Pct)Cache hit ratio is the percentage of successful reads out of all read operations in redis database.
5Redis Rejected Connections/SecNumber of connection disconnected per seconds as Redis instance is currently at its maximum number of connections.
6Redis Key Pending ExpirationTotal number of key expiration events pending in all database.
7Redis Cache Miss Rate (Pct)Cache miss ratio is the percentage of failure reads out of all read operations in redis database.
8Redis Rejected Connections (Pct)Rejected connections in percentage due to max connection limit is reached.
9Redis Last Bgsave Time (Sec)Duration of the last RDB save operation in seconds.

RedisDatabaseStats

Redis server DB stats provides metrics related to total keys, keyspace pending expirations, average time to live.

SNo.MetricMetric Description
1Redis Keys SpacesTotal number of key in database.
2Redis Key Pending ExpirationNumber of key expiration events.
3Redis Average Time To Live Keys (Sec)Average time in seconds to life of keys with an expiration set.
RedisInventoryCache
SNo.MetricMetric Description
1Redis Inventory Cache SKU With Qty ZeroNumber of SKU’s with zero available inventory.
2Redis Inventory Cache SKU With Qty 1-100Number of SKU’s with available inventory in range from 1 to 100.
3Redis Inventory Cache SKU With Qty 101-1000Number of SKU’s with available inventory in range from 101 to 1000.
4Redis Inventory Cache SKU With Qty More Than 1000Number of SKU’s with available inventory above 1000.

RedisLatencyV2
SNo.MetricMetric Description
1Time taken to serve one request (msec)Time taken to serve one request in milliseconds.
RedisReplicationStats

Redis server Replication stats monitor measure health of redis server. It provides metrics related to sync delayed and replay backlog.

SNo.MetricMetric Description
1Redis Sync DelayedRedis sync delayed state. SyncDelay is 1= delay in syncing master to slave, 0 = no delay.
2Redis Replication Backlog (Pct)Replication BackLog in percentage with respect to master replication backlog.
RedisShardsStats

Redis server shard stats provides metrics related to Average TTL, Memory Fragmentation Ratio, Used Memory Lua, Resync Requests, Total Request, Total I/O Bytes and Used Memory etc.

SNo.MetricMetric Description
1Redis Shard AOF ReWrite In ProgressFlag indicating a AOF rewrite operations is ongoing. If flag is off then set it’s value 0 and set it’s value 1 for on flag.
2Redis Shard Average TTL (ms)The average TTL(time to live) is calculated as an approximated keys with an expiration set.
3Redis Shard Blocked ClientsNumber of clients blocked by Redis.
4Redis Shard Connected ClientsNumber of clients connected to Redis.
5Redis Shard Evicted Keys/SecNumber of objects evicted from the database per second.
6Redis Shard Expired Keys/SecNumber of expired objects per sec. An expired object is an object with expired TTL that was deleted from the database.
7Redis Shard Total KeysThe total number of keys stored in databases.
8Redis Shard System Fork Duration (ms)Duration of the System fork operation in milliseconds.
9Redis Shard User Fork Duration (ms)Duration of the User fork operation in milliseconds.
10Redis Shard Instantaneous Input (kbps)The network’s read rate per second in kilobits per second.
11Redis Shard Instantaneous Output (kbps)The network’s write rate per second in kilobits per second.
12Redis Shard Memory Fragmentation RatioThe ratio between the memory allocated by redis and the memory as seen by the operating system.
13Redis Shard Used Memory LUA (MB)Used memory in megabytes by the Lua engine.
14Redis Shard Used Memory (MB)Total number of Megabytes allocated by redis.
15Redis Shard Peak Memory Used (MB)Peak memory consumed by Redis in megabytes.
16Redis Shard Pubsub ChannelsGlobal number of pub/sub channels with client subscriptions.
17Redis Shard Pubsub PatternsGlobal number of pub/sub pattern with client subscriptions.
18Redis Shard RDB ChangesNumber of changes since the last dump.
19Redis Shard Read Hits/SecThe number of read operations successfully per second.
20Redis Shard Read Misses/SecThe number of read operations failed per second.
21Redis Shard Write Hits/SecThe number of write operations successfully per second.
22Redis Shard Write Misses/SecThe number of write failed per second.
23Redis Shard System CPU (Pct)System CPU utilization by the Redis shard.
24Redis Shard User CPU (Pct)User CPU utilization by the Redis shard.
25Redis Shard Full SynchronizationsNumber of times slaves have fully synchronized with master.
26Redis Shard Partial Error SynchronizationsNumber of times partial synchronization have failed to complete.
27Redis Shard Partial OK SynchronizationsNumber of times partial synchronization have completed.
28Redis Shard Total RequestsTotal number of requests received by the redis server.

RedisSlaveStats

Redis Slave stats monitor measure health of redis slaves nodes. It provides metrics related to logging system RDB, master-slave communication.

SNo.MetricMetric Description
1Redis DataBase Operations/SecNumber of changes to the database per second since last dump operation to database
2Redis Slave Last IO Elapsed Time (Sec)Time in seconds since last interaction between slave and master.
3Redis Link Down Time (Sec)Time in seconds of the link between master and slave being down.

RedisSystemStats

Redis server system stats monitor measure health of redis server. It provides metrics related to used Memory, user cpu time, system cpu time, IO SYN Lag Time.

SNo.MetricMetric Description
1Redis Used Memory (MB)Total number of Megabytes allocated by Redis.
2Redis Memory Fragmentation RatioRatio of memory used by the operating system to memory allocated by Redis.
3Redis User CPU Time (Sec)User CPU consumed by Redis server.
4Redis System CPU Time (Sec)System CPU consumed by the Redis server.
5Redis IO SYN Lag Time (sec)Number of seconds since last transfer I/O during a SYNC operation.
6Redis Used Memory RSS (MB)Redis allocated memory in megabytes as seen by the operating system.
7Redis Used Memory Peak (MB)Peak memory consumed by Redis in megabytes.
8Redis Used Memory Lua (MB)Used memory in megabytes by the Lua engine.
9Redis Up Time (sec)Number of seconds since Redis server started.
10Redis Up Time (day)Number of days since Redis server started.
11Redis Children System CPU Time (Sec)System CPU consumed by the background processes.
12Redis Children User CPU Time (Sec)User CPU consumed by the background processes.
RedisperformanceStatsV2

Redis server Performance stats monitor measure health of redis server. It provides metrics related to latency, command/sec, connection received, total command processed.

SNo.MetricMetric Description
1Redis Command Processed/secNumber of operations processed by the database within a given period of interval.
2Redis Connections ReceivedTotal number of connections accepted by the server.
3Redis Commands ProcessedTotal number of commands processed by the server.
4Redis Inbound traffic (Kbps)Total inbound traffic in kilobits per second
5Redis Outbound traffic (Kbps)Total outbound traffic in kilobits per second
6Redis Full SynchronizationsNumber of times slaves have fully synchronized with master.
7Redis Partial OK SynchronizationsCount of the number of times partial syncs have completed.
8Redis Partial Error SynchronizationsCount of the number of times partial syncs have failed to complete.
9Redis Latest Fork Operation (ms)Duration of the latest fork operation in milliseconds.
10Redis Migrate Cached SocketsNumber of migrate cached sockets.
11Redis SlowLog QueriesNumber of slowlog queries.
12Redis SlowLog Queries (Pct)Slowlog query in percentage with respect to total query.
13Redis Average SlowLog Query time (mus)Average slow log query time in microseconds