3

Is there any point to doing disk buffer caching in a virtual machine, if the hypervisor OS is doing it? I wonder if buffering in the VM will just waste memory that could be better allocated to VM use, or if data read will be buffered both in the hypervisor and in the guest OS.

Or is there some system that automatically handles coordination of buffer cache between hypervisor and guest?

Should I turn it off in the host machine, or in the VMs?

1 Answer 1

2

Too many variables, you don't state your workload, filesystem(s), storage specs, host or guest mix, though even if you did I'd probably still just generalise ;-) As a set of guidelines:

  • nothing trumps pragmatic reading of vendor documentation and emprical evidence. vmware in particular have useful and comprehensive white papers
  • each guest ought have the best notion of what to cache, e.g. filesystem metadata might be more useful, only a guest can accurately pre-read, so a guest cache should be more effective
  • if you have deduplicated storage, the vm host caching might be more effective for certain workloads
  • if you overcommit on memory all bets are off
  • memory is always faster than spinning rust, a SAN might make this less noticeable

In theory, a vm guest storage driver could intelligently communicate with the host to optimise buffering, I'm not aware of any specific implementation.

You could probably benefit by reducing vm host buffering, if extra memory helps your guest performance. You can't tell for sure without measurements, so: measure, analyze, tune, repeat as necessary.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.