eG Monitoring
 

Measures reported by RedisKeySpaceTest

Keyspace refers to the internal dictionary that Redis manages, in which all keys are stored.

Normally Redis keys are created without an associated time to live. The key will simply live forever, unless it is removed by the user in an explicit way, for instance using the DEL command.

Administrators can however choose to associate an expire to a given key, at the cost of some additional memory used by the key. When a key has an expire set, Redis will make sure to remove the key when the specified amount of time elapsed.

Most often, administrators may want to look into the keyspace of each Redis database to know how many keys in that database have an expire set, the count of keys that are currently expiring, and how quickly the keys will expire. By periodically running the RedisStatsTest, administrators can find the answers to these questions!

This test provides statistics on the main dictionary of each database. With the help of these statistics, administrators can be proactively notified if keys are expiring or are about to expire. Additionally, the test reports metrics for a Summary descriptor, using which administrators can receive an overview of key expiry across databases.

Outputs of the test : One set of results for each database on the monitored Redis server. Aggregate metrics are also reported for the Summary descriptor.

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
keys Indicates the number of keys associated with this database. Number  
expires Indicates the total number of keys in this database for which an expiration has been set. Number  
avg_ttl Indicates how soon the keys associated with this database will expire Seconds A very low value of this measure indicates the most keys will be expiring very soon.
total_dbs_with_keys Indicates the number of databases with keys Number This measure is reported only for the Summary descriptor.
total_keys Indicates the total number of keys across all databases. Number This measure is reported only for the Summary descriptor.
total_expire_keys Indicates the total number of keys that are currently expiring across databases. Number This measure is reported only for the Summary descriptor.
avg_expire_time Indicates how long the keys across databases will take to expire, in an average. Seconds This measure is reported only for the Summary descriptor.

If this measure reports a non-zero value, then you can quickly compare the value of the avg_ttl measure across databases to know which database is associated with the keys that will be expiring very shortly.
total_dbs Indicates the total number of databases in Redis. Number This measure is reported only for the Summary descriptor.