[openstack-dev] [nova] ram size and huge page number for VM

Daniel P. Berrange berrange at redhat.com
Tue Feb 9 10:20:10 UTC 2016

On Mon, Feb 08, 2016 at 07:47:56PM +0000, Serguei Bezverkhi (sbezverk) wrote:
> Hello,
> I using the latest Liberty and I am trying to bring up a VM with some numa
> options configured using flavor. Specifically I need to give this VM 16GB
> of RAM and in addition  it will need to use 12x1GB huge pages. What I found
> out, there is no way in a flavor to specify RAM size and separately number
> of huge pages, only size is avaialbe, so to achieve what I needed I had to
> specify RAM size of 30GB. It would not be that bad, but instead of taken
> 16GB from server's RAM and 12 GB from Huge pages it has taken whole 30GB
> out of the server's total huge pages pool. Huge waist!!!

It not actually a huge waste - in fact it is likely to be beneficial to the
overall performance of your VM. You need to remember that there is no direct
relationship between allocation of huge pages to KVM and usage of huge pages
inside the guest OS - any combination is valid. In particular if you give
huge pages to KVM, then this has a performance benefit to the guest, even if
the guest OS doesn't use huge pages itself, because it increases the TLB hit
rate in the host for memory accesses by the guest. Using huge pages inside
the guest OS too, increases the TLB hit rate of the guest hardware further
extending this performance benefit. As such hosts which are intended to use
huge pages should have all their host memory allocated to the huge page pool,
except for what is required to run the various host OS services.

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the OpenStack-dev mailing list