DjangoRedis

Redis CPU utilization spikes during cache key deletions

critical
Resource ContentionUpdated Jan 1, 2025(via Exa)
How to detect:

Cache key deletion operations cause Redis CPU utilization to spike to 83%+ because Redis must scan the entire key table to find matching keys to delete. This creates a table-scan scenario that severely degrades performance under load, with CPU utilization climbing steadily as traffic increases.

Recommended action:

Remove or minimize cache key deletion operations from application code. Implement alternative invalidation strategies such as time-based expiration or timestamp-based invalidation metadata. Monitor EngineCPUUtilization and CPU Utilization metrics together. If deletions are necessary, use pipelining with HiredisParser for batch operations. Test in dedicated performance environment before deployment.