Ravi Teja Adabala
Ravi Teja Adabala

Reputation: 51

checkpoint_completion_target being ignored

I'm testing checkpoint_completion_target in RDS PostgreSQL and see that checkpoint is taking total time of 28.5 seconds. However, I configured the

checkpoint_completion_target = 0.9
checkpoint_timeout = 300

According to this, should the checkpoint spread for 300*0.9 which is 270 seconds? PostgreSQL version 11.10

Log:

2021-03-19 16:06:47 UTC::@:[25023]:LOG:  checkpoint starting: time
2021-03-19 16:07:16 UTC::@:[25023]:LOG:  checkpoint complete: wrote 283 buffers (0.2%); 0 WAL file(s) added, 0 removed, 1 recycled; write=28.500 s, sync=0.006 s, total=28.533 s; sync files=56, longest=0.006 s, average=0.000 s; distance=64990 kB, estimate=68721 kB

Upvotes: 0

Views: 630

Answers (1)

jjanes
jjanes

Reputation: 44137

The checkpointer implements its throttling by napping in 0.1 second chunks. And there is no provision for taking more than one nap per buffer needing to be written. So if there is very little work to be done, it will finish early despite the setting of checkpoint_completion_target.

Upvotes: 1

Related Questions