PostgreSQLCacheHitRatio
PostgreSQL low on cache hit rate on {{ $labels.cluster }} for database {{ $labels.datname }} with a value of {{ $value }}
>>>
avg
(
rate
(
{datname!~"template.*"}[5m]) / (
rate
(
{datname!~"template.*"}[5m]) +
rate
(
{datname!~"template.*"}[5m]))) by (datname) < 0.98
The query computes, for each non‑template database, the 5‑minute average cache‑hit ratio as hits / (hits + reads) (using pg_stat_database_blks_hit and pg_stat_database_blks_read). The alert fires when this averaged ratio falls below 0.98, indicating the database’s cache hit rate is too low.
Exporters Used
Get Alert✕
Download
Copy to Clipboard