I have a number of servers that we use as KVM hypervisor nodes. We want to enable hugepages and leverage this features for performance related matters.
I have looked online on how to enable hugepages, and that is quite clear and simple, what I cant find though is how to determine the hugepages count value that should be used.
To give you some perspective, this is the system we have (same across the entire cluster):
$ free -g
total used free shared buff/cache available
Mem: 503 5 497 0 1 495
Swap: 0 0 0
We want to enable hugepages of 1GB in size, but the HugePages count is what we dont know how to define. How is this number determined, is it memory based, any input would be appreciated.
Config in question:
GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX hugepagesz=1G hugepages=<what goes here> transparent_hugepage=never"