PG-R10reliabilityReversibility: safe

Replication Lag

pg_views: pg_stat_replication, pg_replication_slots

Full detection logic, thresholds, and guided fixes ship in the product.

Book a demo →

Overview

Replication lag measures how far behind a standby server is from the primary. For streaming replication, insightral tracks write_lag, flush_lag, and replay_lag. For logical replication slots, it tracks the volume of WAL retained on disk waiting to be consumed. Both types of lag matter: streaming lag means reads from the replica are stale, while slot lag means the primary cannot recycle WAL, eventually filling the disk.

An inactive or abandoned replication slot is particularly dangerous because it silently retains WAL indefinitely. insightral flags both lag > 30 seconds on streaming replicas and replication slots retaining > 1 GB of WAL as findings.

See this rule in action

Full detection logic, thresholds, and guided fixes ship in the product. The licensed agent runs this check — and all others — continuously against your database, surfaces findings with AI explanations, and surfaces a guided remediation path inside the dashboard.

Book a demo →

Common False Positives

Replication Lag — and 100+ more checks — in the licensed product

Full detection logic, thresholds, and guided fixes ship in the product.

Book a demo →

Last updated: 2026-05-13 · View the rule library