2018-02-01 Greg Clough

Monitoring bgwriter efficiency during checkpoints with pg_buffercache

Have you ever wanted to know what’s happening inside your PostgreSQL buffer cache? Is your bgwriter keeping up, or are you suffering with a lot of dirty buffers during a checkpoint? Uncloak some of the mystery by using the pg_buffercache extension: CREATE EXTENSION pg_buffercache; You can then use the following query: SELECT buffer_status, sum(count) AS […]

2018-01-10 Greg Clough

Faster shutdowns with checkpoint

Have you ever restarted your PostgreSQL cluster and wondered why it’s taking so long? The cause of this is generally one of these: You didn’t include the “-m fast” flag (v9.4 and earlier), and sessions are still connected A large update query is rolling back There are a large number of dirty blocks, which are […]