2018-03-28 Greg Clough

Don’t use “kill” on PostgreSQL… or you’re gonna have a bad time!

Have you ever been tempted to “kill -9” a non-behaving PostgreSQL client session that won’t die via “pg_cancel_backend()” or “pg_terminate_backend()“? Let’s just say that at first you may believe (incorrectly) that it will affect only the single session you’ve killed, but in reality it’s an incredibly bad idea… as the result will be ALL of […]

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 […]