Search code examples
postgresql

Postgres Checkpointer process always running


I am running PostgreSQL server and limited the shared_buffers to 4GB.

When I insert a large number of records in the database, the checkpointer process start consuming the RAM. This process neither ends nor decreases the RAM consumption even after a day.

enter image description here

Any idea why this is happening?


Solution

  • That is perfectly fine. The memory reported as allocated to the process is in fact the shared memory of shared_buffers that remains allocated for the entire life of the PostgreSQL server process.

    Since it is the job of the checkpointer to read dirty pages from shared buffers and write them to disk, it is to be expected that the process reads a lot of that memory.

    If you want to reduce the amount of disk I/O the checkpointer has to perform during bulk inserts, increase max_wal_size.

    To see how much RAM is still free on your machine, consult the "available" field of the free output.