Redis Persistence Test
Redis provides a different range of persistence options:
-
RDB (Redis Database): The RDB persistence performs point-in-time snapshots of your dataset at specified intervals. By default Redis saves snapshots of the dataset on disk, in a binary file called dump.rdb. You can configure Redis to have it save the dataset every N seconds if there are at least M changes in the dataset, or you can manually call the SAVE or BGSAVE commands. This strategy is known as snapshotting.
-
AOF (Append Only File): The AOF persistence logs every write operation received by the server, that will be played again at server startup, reconstructing the original dataset. Commands are logged using the same format as the Redis protocol itself, in an append-only fashion. Redis is able to rewrite the log in the background when it gets too big.
-
No persistence: If you wish, you can disable persistence completely, if you want your data to just exist as long as the server is running.
-
RDB + AOF: It is possible to combine both AOF and RDB in the same instance. Notice that, in this case, when Redis restarts the AOF file will be used to reconstruct the original dataset since it is guaranteed to be the most complete.
Where one or a combination of persistence options are at play, administrators may want to closely track the status of related operations, so they can proactively detect deviations from the norm. The Redis Persistence test helps administrators with this!
This test tracks the status of operations related to RDB and AOF persistence options and instantly notifies administrators of real/potential anomalies, so that data durability and integrity are not compromised.
Target of the test :A Redis server
Agent deploying the test : An internal agent (recommended)
Outputs of the test : One set of results for the target Redis server
Parameters | Description |
---|---|
Test period |
How often should the test be executed |
Host |
The host for which the test is to be configured. |
Port |
The port at which the specified HOST listens. |
Redis Password and Confirm Password |
In some high security environments, a password may have been set for the Redis server, so as to protect it from unauthorized accesses/abuse. If such a password has been set for the monitored Redis server, then specify that password against REDIS PASSWORD. Then, confirm the password by retyping it against CONFIRM PASSWORD. If the Redis server is not password protected, then do not disturb the default setting of this parameter. To determine whether/not the target Redis server is password-protected, do the following:
|
Measurement | Description | Measurement Unit | Interpretation | ||||||
---|---|---|---|---|---|---|---|---|---|
Dump file loading in progress? |
Indicates whether/not the dump file is being loaded or not. |
|
The values that this measure can report and their corresponding numeric values are listed in the table below:
Note: This measure reports the Measure Values listed in the table above to indicate whether/not the dump file is being loaded as part of the snapshotting process. The graph of this measure however, indicates the same using the numeric equivalents only. |
||||||
Redis RDB save is in progress? |
Indicates whether/not RDB file is being saved. |
Number |
The values that this measure can report and their corresponding numeric values are listed in the table below:
Note: This measure reports the Measure Values listed in the table above to indicate whether/not the RDB file is being saved. The graph of this measure however, indicates the same using the numeric equivalents only. |
||||||
Number of changes since last save |
Indicates the number of changes since the last dump. |
Number |
You can configure Redis to have it save the dataset every N seconds if there are at least M changes in the dataset, or you can manually call the SAVE or BGSAVE commands. Track changes to this measure over time to determine whether/not the number of changes configuration is optimal. |
||||||
Last successful RDB save |
Indicates when the last successful RDB save occurred. |
Date |
If the gap between the current date and the value of this measure is very wide, it can indicate one of the following:
The latter will need investigation. In case of the former, you may want to change how and when snapshotting should occur , depending upon your data durability needs. |
||||||
Duration of the last RDB save operation in seconds |
Indicates how long the last RDB save took. |
Seconds |
Ideally, the value of this measure should be low. |
||||||
Append only file logging enabled? |
Indicates whether/not the AOF persistence option is enabled. |
|
The values that this measure can report and their corresponding numeric values are listed in the table below:
Note: This measure reports the Measure Values listed in the table above to indicate whether/not AOF is enabled. The graph of this measure however, indicates the same using the numeric equivalents only.
|
||||||
Append only file rewrite operation is in progress? |
Indicates whether/not AOF rewrite is in progress. |
|
If AOF is enabled, every time Redis receives a command that changes the dataset (e.g. SET) it will append it to the AOF. When you restart Redis it will re-play the AOF to rebuild the state. As you can guess, the AOF gets bigger and bigger as write operations are performed. For example, if you are incrementing a counter 100 times, you will end up with a single key in your dataset containing the final value, but 100 entries in your AOF. 99 of those entries are not needed to rebuild the current state. So Redis supports an interesting feature: it is able to rebuild the AOF in the background without interrupting service to clients. Whenever you issue a BGREWRITEAOF Redis will write the shortest sequence of commands needed to rebuild the current dataset in memory. This measure reports the status of this BGREWRITEAOF operation. The values that this measure can report and their corresponding numeric values are listed in the table below:
Note: This measure reports the Measure Values listed in the table above to indicate whether/not the AOD rewrite is in progress. The graph of this measure however, indicates the same using the numeric equivalents only. |
||||||
Append only file rewrite operation is scheduled? |
Indicates if an AOF rewrite operation is scheduled to occur once the on-going RDB save is complete. |
|
Redis >= 2.4 makes sure to avoid triggering an AOF rewrite when an RDB snapshotting operation is already in progress, or allowing a BGSAVE while the AOF rewrite is in progress. This prevents two Redis background processes from doing heavy disk I/O at the same time. When snapshotting is in progress and the user explicitly requests a log rewrite operation using BGREWRITEAOF the server will reply with an OK status code telling the user the operation is scheduled, and the rewrite will start once the snapshotting is completed. The values that this measure can report and their corresponding numeric values are listed in the table below:
Note: This measure reports the Measure Values listed in the table above to indicate whether/not AOF rewriting is scheduled. The graph of this measure however, indicates the same using the numeric equivalents only. |
||||||
Append only file current file size |
Indicates the current size of the AOF file. |
MB |
|
||||||
Append only file buffer size |
Indicates the size of the AOF file buffer. |
MB |
|