Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When running VMs on an ESXi host, you can overcommit the memory.

Example: host == 20GB physical RAM

The amount of RAM allocated to each VM is

  • VM1 == 10gb
  • VM2 == 10gb
  • VM3 == 10gb
  • VM4 == 10gb

The result is even though there is only 20GB of ram available, We have actually allocated 40GB of it.

There is no problem with this if each machine uses and average of 5GB of "active" memory (inactive memory is swapped out in a few different manners).

The issue is, VM1 does a big file operation, the kernel writes an additional 5GB to it's RAM. As this is just written, the esx host considers it as active memory, and starts swapping out memory from the other running VMs (thus hitting their performance).

Flushing the cache after a big operation (using is not a great option as the host has already started penalising the other VMs.)

The above is a simplification (the actual problem VM has 32GB of RAM assigned), but essentially:

tl;dr

How do I limit the max size of the disk cache on a linux kernel.

share|improve this question
    
Cgroups could be of help - by specifying a "guaranteed minimum" memory for all the VMs you might be able to at least slightly alleviate the problem. –  peterph Jan 18 '13 at 23:05
add comment

1 Answer

What are your real numbers, versus the simplified representation above?

I'd argue that you shouldn't overcommit your RAM to that degree. Obviously, more RAM should be an option. Have you considered leveraging an SSD and enabling the Swap to SSD/host cache feature?

share|improve this answer
    
Actual problem VM size is 32GB. I completely agree that he should reduce the RAM allocation of this WM. I think the total over commit on the host is actually about 20% which is fine. I heard there was a way of limiting this disk cache size in windows, so assumed there would be in linux also. I think real solution would be to reduce RAM allocation on VM, but apparently it may be needed by program data (not disk cache) –  Rqomey Jan 21 '13 at 10:57
add comment

Your Answer

 
discard

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.