Trying to add hugepages to sysctl and system fails to boot

I am trying to improve the performance of KVM and have been testing hugepages. They appear to work when enables dynamically using
sudo sysctl -w vm.nr_hugepages=102400
but when I add it to sysctl.d there are problems.

I am adding a new file “/etc/sysctl.d/hugepages.conf” with the line
vm.nr_hugepages = 102400
with the correct selinux context. 102400 is just a random number copied from an example which I was going to tune once all was settled.

Booting seems to hang trying to mount the filesystems. There is a lot of IO as indicated by the flashing red light but very slow progress (20 minutes) as mounts and services fail. Eventually it will come to the emergency login prompt.

Did you follow this guide?

https://www.linux-kvm.org/page/UsingLargePages

Thanks, this helped. The guide I was using was missing a few things.

1 Like