Monday, February 18

Tag: lsn

PG Phriday: Terrific Throughput Tracking

Shaun's PlanetPostgreSQL
Postgres has a lot of built-in information functions that most people don't know about. Some of these are critical components to identifying replication lag, but what if we could use them for something else, like throughput? This man's one simple trick can track actual database throughput; DBAs hate him! Everybody Knows Let's take a look at a common query we might use to track replication lag between a Postgres 11 Primary and one or more Replica nodes. SELECT client_addr, pg_wal_lsn_diff( pg_current_wal_lsn(), sent_lsn ) AS sent_lag, pg_wal_lsn_diff( pg_current_wal_lsn(), write_lsn ) AS write_lag, pg_wal_lsn_diff( pg_current_wal_lsn(), flush_lsn ) AS flush_lag (more…)