How frequently does windows flush the write cache?

Windows flushes its internal file cache on an eight-second rotating window. That is, every second, one-eighth of the dirty pages in the cache are queued for writing. The actual writing may take longer. Also, other factors may cause the writes to be delayed.

The drive's own on-board cache, as well as Windows' cache, is guaranteed to be flushed when you go through the "safely disconnect" dialog. It won't tell you "safe to remove" until the writes are actually completed in Windows and the drive reports that the command to flush its internal buffers to the media has finished.


Microsoft's recommendation is to not turn off write-cache buffer flushing unless the connected device has its own power supply, in order to prevent loss in case of power outage. This is straight from the Disk properties/Policies tab (see image below).

write-cache buffer flushing

The buffers should flush only on confirmed write, but there are some interoperation issues with a disk's cache. But as far as a power failure, we are talking about a couple of seconds. That is, you won't have data loss unless the power outage happens within two seconds of a write.

If you lose power in the middle of a call to FlushFileBuffers, you could end up with just partial writes, as complete write isn't done before the buffer is fully flushed. There is an index store which points to where the data actually is. This index store is written first.