Question
How Should I Calculate Swap Size on Virtualization Hosts?
Answer
First, calculate the estimated maximum overcommit ratio:
((sum of assigned memory of all virtual machines) / physical available memory)-1=overcommit ratio
Based on this calculate recommended swap size:
(0.5 * memory) + (overcommit ratio * memory) = recommended swap size
Example:
Host has physically 32GB of memory.
There are 10 virtual machines configured with each 4GB of memory assigned.
overcommit ratio=(10 * 4)/32-1=0.25
swap size=(0.5 * 32)+(0.25 * 32)=24GB
In this case, swap space of 24GB should be configured.