Thread: What is the relationship between checkpoint_completion_target and the OS write cache (dirty_background_ratio, dirty_ratio )?
What is the relationship between checkpoint_completion_target and the OS write cache (dirty_background_ratio, dirty_ratio )?
Hello everyone, checking the checkpoints theme and the configuration of memory buffers for writing on to the operating system (vm.dirty_background_ratio and
Vm.dirty_ratio = 2), I wanted to know what the relationship exists between these parameters and checkpoint_completion_target, because in this link https://blog.2ndquadrant.com/basics-of-tuning-checkpoints/ (quite interesting) mention that they should Configure these kernel parameters to prevent many dirty pages from accumulating in the cache.
If synchronous_commit = on, it means that each write action will be persisted in the redo logs before the final commit of the transaction, and after a checkpoint all the generated Wal will be synchronized with the data files, then in this scenario:
The bgwriter plays some role during bgwriter_delay by writing the changes of the shared buffers directly to the data files or the write cache of the operating system or simply does nothing in synchronous commit mode.
Is Wal_buffers used in synchronous mode?
If after each commit an fsync is executed to write to disk the data generated by the transaction, what information is stored in the operating system's write cache, and how much can this value grow if there is write after each transaction?
Any documentation related to these issues will be well appreciated.
Regards and many thanks to all for your time.