Tuning with background writer statistics

In this recipe, we will be discussing how PostgreSQL's background writer (bgwriter) process plays an important role in fine tuning PostgreSQL memory and checkpoint related information.

Getting ready

The bgwriter process is a mandatory background process in a PostgreSQL instance. Its main responsibility is to flush the buffers from memory to disk. Besides, it will also keep the shared buffers ready by flushing the least used dirty buffers from memory to disk, based on bgwriter_lru_maxpages, bgwriter_lru_multiplier parameter settings. In PostgreSQL, checkpoint activity is a heavy process, as it is going to flush many dirty buffers into the physical disk, which will increase a great utilization in I/O.

When an ...

Get PostgreSQL High Performance Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.