Help Center> Distributed Cache Service> Troubleshooting> Troubleshooting 100% CPU Usage of a DCS Redis Instance

Troubleshooting 100% CPU Usage of a DCS Redis Instance

Symptom

The CPU usage of a Redis instance spikes to 100% within a short period of time.

Fault Locating

  1. Check the monitoring data generated during the period when the problem occurred.

    Redis is single-threaded. If CPU usage suddenly surges at a specific point in time, an operation may have blocked the thread. In this case, check whether the slow log exists.

  2. Go to the Performance Monitoring page of the instance and check Slow Query Logs metric.

    If the slow log exists, check the slow log.

  3. Go to the Slow Log page of the instance and check the slow log generated during the specified period.

    The KEYS command may have caused the slow log. Running the KEYS command will initiate the search for all keys that meet the conditions, which occupies an excessive amount of CPU resources and may deteriorate performance. Instead, you can run the SCAN command or disable the KEYS command.