Wednesday, August 17, 2011

Background Flushing

Background flushing in linux happens when either of following condition reached

Too much written data is pending (/proc/sys/vm/dirty_background_ratio)

Timeout of pending writes is reached(/proc/sys/vm/dirty_expire_centisecs)

In above circumstances, unless another hit ( /proc/sys/vm/dirty_ratio) is not reached ,more written data may be cached and further writes will block.

In theory this will create a background process without disturbing other process but in practical it does disturbance to the other process which are doing uncached reading or synchronized writing. The reason of this may be background process writing with the 100% device speed, as a result other process halt. I got the fact that clearing dirty caches may solve this issue

Clear Cache from memory

root# echo 3>/proc/sys/vm/drop_caches

And its recommended to run 'sync' command before clearing cache