Score:0

How to configure hugepages on CentOS Stream 9

tr flag

I need to reserve 12288 hugepages for QEMU/KVM virtual machines.

I followed the guide in 3 easy steps to configure hugepages in RHEL/CentOS 7/8 but it looks like in CentOS Stream 9 the configuration file /etc/sysctl.conf is not for manual edit any more.

grep -i huge /proc/meminfo
AnonHugePages:   1986560 kB
ShmemHugePages:        0 kB
FileHugePages:         0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB

when I try to modify the file nano /etc/sysctl.conf it shows that this setting moved in another place

# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).

What is the proper way of hugepages configuration in CentOS Stream 9?

Score:1
cn flag

Move vm.nr_hugepages from /etc/sysctl.conf into a .conf file with your choice of name. Of those, /etc is for site-specific persistent settings, so /etc/sysctl.d/hugepages.conf

Drop-in config files like this are easy to deploy. Can copy in files for very specific purposes, like a VM host or a database or a router, without touching other tuning. Managing half of a config file is actually tricky.

Reboot. Huge pages require contiguous memory.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.