INFO memory
to get an overview of the current memory usage of your Redis instance.MEMORY USAGE <key>
command on your keys to find any that are using a disproportionate amount of memory.MONITOR
(use with caution as it can reduce performance) to see real-time commands being executed, or INFO commandstats
for statistics about command executions.CONFIG GET maxmemory-policy
to see the current eviction policy. If it's set to 'noeviction', you might need to change it to handle memory better.RANDOMKEY
or SCAN
in a loop combined with TTL
to check if keys are set to expire. If many keys never expire, this might be an issue.maxmemory
setting via CONFIG SET maxmemory <bytes>
to allow Redis to use more memory.DEL <key>
to manually remove them. CONFIG SET maxmemory-policy <policy-name>
to something like allkeys-lru
to automatically manage memory.BGSAVE
and then restart the Redis server to clear the entire memory, but this will result in downtime.(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)