Virtual Machines and Caching

Chiefcrowe

Diamond Member
Sep 15, 2008
5,056
199
116
Do you set your virtual hard drives to turn of write caching?
I have been told that is the best practice but I wanted to see what the consensus was.
 

dawks

Diamond Member
Oct 9, 1999
5,071
2
81
My computer is on a UPS so I leave Write Caching on. I've never benchmarked it, but I assume its adding some amount of increased performance.

File Systems are pretty resilient to corruption, but with Virtualization you're technically adding 2 layers (the Guest OS filesystem, the VM software, and the host OS filesystem - unless its a standalone hypervisor), which can increase the possibility of corruption.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
It is on on all of my VMs. I am also backed up by hours of UPS and battery backed up disk controllers.
 

spikespiegal

Golden Member
Oct 10, 2005
1,219
9
76
Are you talking about the guest VMs, or the actual host VM?

In respect to the guest VM's I don't think it matters because the host is going to emulate all the device responses anyways which are invisible to the guest VM. I know this gets a bit technical when you start dealing with low level hypervisors and such, but everything I've seen shows it doesn't matter in terms of the guest.

In terms of the host, it can make a huge difference. Write-though disk access (cacheing off) is only advised when you have a single guest VM that you wish to basically take over the disk (or RAID controller).

In all other scenarios, if you have more than one guest VM then write-back (cache on) should be enabled. With typical onboard SATA controllers this typically isn't pertinent, but with better RAID controllers involved not having write-back (cache-on) enabled can cause catastrophic disk problems with more than one VM . I've seen VMs seize up for minutes at a time when when multiple guests try to write to a disk array when write-through (cache-off) was toggled.
 

Chiefcrowe

Diamond Member
Sep 15, 2008
5,056
199
116
I'm talking about in the guest VMs. I also read that for virtual domain controllers, caching should be turned off under the properties of the HD.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
I'm talking about in the guest VMs. I also read that for virtual domain controllers, caching should be turned off under the properties of the HD.

Should be that way for physical DC's.

Only exception is battery backed up ones that have a proper shutdown interface with the UPS. And even those it often isn't worth it.