[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

KVM: writethrough / writeback - data integrity



All,

should one use writethrough or writeback caching mode on a production
server? I've read on the Internet that writethrough was more secure. With
writeback there could be data loss in case of power failure?

On the other hand, writeback is Ubuntu's default mode. Is a Debian Jessie
VirtIO guest capable of handling "flush disk caches" correctly? I don't
know the low-level details.

Furthermore, does it matter that the raw-partition respectively raw-image
is on a hardware RAID 5?

Thank you in advance.

- Chris


https://www.ibm.com/support/knowledgecenter/linuxonibm/liaat/liaatbpkvmguestcache.htm
says:

writethrough: mode is the default caching mode. With caching set to
writethrough mode, the host page cache is enabled, but the disk write
cache is disabled for the guest. Consequently, this caching mode ensures
data integrity even if the applications and storage stack in the guest do
not transfer data to permanent storage properly (either through fsync
operations or file system barriers).

writeback: writeback With caching set to writeback mode, both the host
page cache and the disk write cache are enabled for the guest. Because of
this, the I/O performance for applications running in the guest is good,
but the data is not protected in a power failure. As a result, this
caching mode is recommended only for temporary data where potential data
loss is not a concern.


Reply to: