Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say you have a base server running several KVM guests. Now with regards to disk I/O caching, it would seem that the base server would cache the I/O in its memory, but wouldn't the guest also cache the same I/O in its memory pool also? If so, wouldn't this waste memory if the disk contents are cached twice? If this is the case, then what would be a good way to tune this behavior (i.e., either cache everything from the base server, or cache nothing from the base and only from withing the guests)? The only way I can think of is to allocate the guests with less memory that you normally would, set the swappiness parameter in the guests to 0 (so process memory doesn't get swapped out in favor of disk caching), so there is no extra memory in the guests that they can use for cache. This would then force all caching to happen in the base server. Or, is this an issue that is somehow solved automatically by KVM?

share|improve this question

Yes, guests would use their memory for disk caching. Just like a non-virtual system would do.

Caching that may happen on the hypervisor depends on the type of disk interface you use for your guest and the type of cache policy you select. But whatever your choices are, caching on the hypervisor ould only happen for data the guest is wiling to commit to it's virtual drive, not with cached data.

share|improve this answer

This is why there are additional tunings available. For KVM guests, it is recommended to at least use noop in the guest and deadline on the host. Deadline in the guest can sometimes yield better results, depending on the IO pattern.

There are additional tunings available (dataplane, vhost-blk etc), each with it's own set of advantages and limitations.

Old, but still useful:

share|improve this answer
The i/o scheduler is unrelated to the page cache. – sciurus Jan 19 '14 at 19:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.