I have got the impression that you can configure an OpenStack cluster to over-commit vCPUs and memory for KVM instances.
I suppose over-committing vCPUs is relatively harmless; I guess instances on a host will just have to time-share the available physical CPUs and will get slowed down proportionately if CPU demand exceeds physical capacity.
For memory, I suppose it must be a quite different story if the instances exceed the physical capacity of the host.
What actually happens if you have over-committed memory allocation in your cluster and the instances running on a host outspend the physical capacity of the hosts memory? Does it start swapping to disk (and - I assume - get slowed down drastically as a result)? Do the instances simply crash, or something completely different?

- 111
- 3
1 Answers
You can overcommit CPU as well as memory
https://docs.openstack.org/arch-design/design-compute/design-compute-overcommit.html
the effect of actual memory consumption exceeding physical memory of the hypervisor is explained quite well here https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-overcommitting_with_kvm-overcommitting_memory
Overcommitting is not an ideal solution for general memory issues. The recommended methods to deal with memory shortage are to allocate less memory per guest, add more physical memory to the host, or utilize swap space.
A virtual machine will run slower if it is swapped frequently. In addition, overcommitting can cause the system to run out of memory (OOM), which may lead to the Linux kernel shutting down important system processes.

- 1,175
- 1
- 7