There are two mechanisms for deleting a key in the open-source Redis:
l Lazy deletion: Before a read/write command is executed, the key to be accessed is checked for whether it has expired. If it has expired, it will be deleted. If the key has not expired, the command execution resumes.
l Scheduled deletion: Implemented by a Redis scheduled task. Each time the task is executed, a certain number of keys are randomly collected from the keyspace for inspection and expired keys are deleted.
CT-DCS allows you to immediately/periodically release all memory occupied by expired keys. You can choose to execute the task immediately or configure a scheduled cleanup task to clean up the expired keys of the Redis instance. During the task execution, a scan is performed on the active nodes of all DCS instances. The scan operation traverses the keyspace of the entire instance, and performs a del operation on expired instances to release the expired keys.
Description
Expired key scanning consumes CPU resources and is recommended to be performed during off-peak hours.
Before You Begin
A DCS Redis cluster version instance that has been successfully created and is running.
Procedure
1. Log in to the Redis management console.
2. Select the region of the instance in the upper left corner of the management console.
3. On the instance list page, click the target instance name to go to the instance details page.
4. Click on metric monitoring. This page includes basic metrics, node metrics, client sessions, top key analysis, offline full-key analysis, and expired key scanning.
5. Select the Expired KEY Scan tab page above to scan expired keys. It supports Scan Now and Schedule Scan.
6. Click Scan Now and a scan record will be generated: