Redis

Expiring Keys Without TTL Monitoring Causes Memory Leaks

warning
storageUpdated Mar 2, 2026

When redis.persist count is high relative to redis.db.expires, many keys lack TTLs and will accumulate indefinitely, causing memory growth. redis.keyspace.avg_ttl can indicate if TTL values are too long for workload patterns.

Technologies:
How to detect:

Monitor redis.db.expires / redis.db.keys ratio. Low ratio (<0.3) indicates many keys without TTLs that may never expire. Track redis.keyspace.avg_ttl to ensure TTLs match data lifetime requirements. Watch redis.memory.used trending upward without corresponding increase in workload.

Recommended action:

Review application code to ensure all cached data has appropriate TTLs. Use EXPIRE command or SET with EX/PX options. Implement Redis key naming patterns that encode intended lifetime. Use redis-cli with --scan option to identify keys without TTLs. Consider setting default-ttl via application-level wrapper if many keys lack expiration. For debugging, use TTL command to check individual key expiration settings.