RedisOutOfSystemMemory #
Redis is running out of system memory (> 90%)
Alert Rule
alert: RedisOutOfSystemMemory
annotations:
description: |-
Redis is running out of system memory (> 90%)
VALUE = {{ $value }}
LABELS = {{ $labels }}
runbook: https://srerun.github.io/prometheus-alerts/runbooks/oliver006-redis-exporter/redisoutofsystemmemory/
summary: Redis out of system memory (instance {{ $labels.instance }})
expr: redis_memory_used_bytes / redis_total_system_memory_bytes * 100 > 90
for: 2m
labels:
severity: warning
Here is a runbook for the RedisOutOfSystemMemory alert:
Meaning #
The RedisOutOfSystemMemory alert is triggered when the used memory of a Redis instance exceeds 90% of the total system memory. This indicates that Redis is running low on available memory, which can lead to performance issues, increased latency, and even crashes.
Impact #
If left unaddressed, this alert can have a significant impact on the system’s performance and availability. Some potential consequences include:
- Slow response times and increased latency for Redis queries
- Increased risk of Redis crashes or failures, leading to data loss or corruption
- Cascading failures in dependent systems or applications
- Decreased system reliability and availability
Diagnosis #
To diagnose the issue, follow these steps:
- Check the Redis instance’s memory usage using the
redis_info
command or a monitoring tool like Prometheus. - Verify that the system has sufficient memory available and that there are no other resource-intensive processes running on the same host.
- Review the Redis configuration to ensure that the
maxmemory
setting is set appropriately for the instance. - Check for any memory leaks or inefficient usage in Redis or dependent applications.
Mitigation #
To mitigate the issue, follow these steps:
- Immediately add more memory to the system or terminate any unnecessary processes to free up memory.
- Investigate and address any memory leaks or inefficient usage in Redis or dependent applications.
- Adjust the
maxmemory
setting in the Redis configuration to prevent memory exhaustion. - Consider implementing memory-efficient data structures and algorithms in Redis or dependent applications.
- Monitor the Redis instance’s memory usage closely and adjust the alert threshold as necessary to prevent false positives.
Remember to update the alert rule and runbook accordingly to reflect the changes made to the system.