The write_through
configuration string controls whether the disk is allowed to cache the writes. Enabling this flag increases write latency as the drive must ensure all writes are persisted to disk, but it ensures write durability.
WiredTiger supports two configuration options related to the system buffer cache:
The first is os_cache_dirty_max
, the maximum dirty bytes an object is allowed to have in the system buffer cache. Once this many bytes from an object are written into the system buffer cache, WiredTiger will attempt to schedule writes for all of the dirty blocks the object has in the system buffer cache. This configuration option allows applications to flush dirty blocks from the object, avoiding stalling any underlying drives when the object is subsequently flushed to disk as part of a durability operation.
An example of configuring os_cache_dirty_max:
The os_cache_dirty_max
configuration is based on the non-standard Linux sync_file_range
system call and will be ignored if set and that call is not available.
The second configuration option related to the system buffer cache is os_cache_max
, the maximum bytes an object is allowed to have in the system buffer cache. Once this many bytes from an object are either read into or written from the system buffer cache, WiredTiger will attempt to evict all of the object's blocks from the buffer cache. This configuration option allows applications to evict blocks from the system buffer cache to limit double-buffering and system buffer cache overhead.
An example of configuring os_cache_max:
The os_cache_max
configuration is based on the POSIX 1003.1 standard posix_fadvise
system call and may not available on all platforms.
Configuring os_cache_dirty_max
or os_cache_max
both have the side effect of turning off memory-mapping of objects in WiredTiger.