← Back to context

Comment by vanderZwan

5 months ago

I am guessing that they're implying that a VM effectively loaded the "hard drive" that Windows uses into a RAM-disk, so one would be comparing loading dlls and whatnot from RAM vs loading it from spinning rust.

I'm not sure how true that is, because in the Windows XP days most of us wouldn't have had enough RAM to spare to do that.

More to the point, if the VM could do that caching, why wouldn't Windows be able to do the same level of caching on bare metal?

  • Sorta. The devil in the details here.

    Depending on the VM technology they use they offer a variety of different caching mode and configurations, but the basic three approaches that most everybody offers are going to be something like;

    "writeback" means that when the guest's storage data ends up in the host's cache it is reported back to the guest as 'written'. This means that from the guest's perspective the disk is written to, but in actuality the data is still floating around in memory. If the guest wants data to be 'safe' they need to issue additional flush commands.

    "writethrough" means that the host is using its memory for caching file system, but that writes are reported as 'competed' only when they have been committed to actual disk.

    and "none" means the cache is used as little as possible.

    So if your guest's virtual disk is in 'writeback' mode it isn't actually writing to real disk. It is writing to memory. Which is going to be very fast up to the point were the cache on the host is exhausted.

    Certainly Windows could lie to applications and not write information to disk and keep it in memory much longer then it normally would but that would defeat some of the assurances that file systems are supposed to offer to applications.

    'writeback' would be closer to what Windows already implements on the OS level, but because Linux is just plain faster it should improve performance somewhat. Microsoft can only work in improving the performance of Windows to get the same results, but Linux is pretty hard to beat.

    'none' is what I use when running Linux on Linux because having two layers of cache is just kinda wasteful and doesn't result in real improved performance.

    • So if I understand correctly, you're suggesting that in essence the VM lied to Windows to improve performance? It's been many years, but I don't imagine I would have chosen an option like that. I am very surprised VMWare would default to such behavior.

      1 reply →