https://docs.oracle.com/en/database/oracle/oracle-database/23/ladbi/configuring_hugepages.html

run:

echo 1024 | sudo tee /proc/sys/vm/nr_hugepages



NUMA NODE (NPS) and huge pages

Path A: (Huge pages + node binding) Bz will attempt to first allocate huge pages and bind to the nearest numa node.

Path B: (Node binding only) If this fails, it will fall back to allocating normal memory and binding to numa nodes.

Path C: (Huge pages only) If this fails, bz will attempt to just allocate Huge pages (the os will decide which nodes to allocate to)

Path D: (Normal memory allocation) Finally if this fails, bz will just allocate regular memory

nodes may not have enough huge pages for an allocation which could cause the Path A to fail. Use `numastat -m` and find HugePages_Total and HugePages_Free. if these are 0 or lower than the number of huge pages bz is trying to allocate for the nodes, try running the below command:

sudo sh -c 'echo 2000 > /proc/sys/vm/nr_hugepages'

You can change 2000 to something else, but make sure its larger than the number of huge pages bz is trying to allocate (can be found in debug logs in "final page count" in bz when it tries to allocate huge pages)

For a more permanent solution (persists after reboot), try the below command:

edit /etc/sysctl.conf

add (or edit) the line:

vm.nr_hugepages = 2000

changing 2000 to a number higher than bz is trying to allocate

By default huge pages are 2mb or 1gb in size, so the number of huge pages multiplied by 2mb will be the total amount of memory in huge pages supported


for 1gb huge pages:

- edit grub
sudo nano /etc/default/grub

- find GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

- add  default_hugepagesz=1G hugepagesz=1G hugepages=2 so command now looks something like:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash default_hugepagesz=1G hugepagesz=1G hugepages=2"

- can set hugepages=3 if rig is dedicated to mining

- update grub

sudo update-grub

sudo reboot