Activate huge pages on Ubuntu/linux XMRIG
Huge Pages
- XMRig
- Huge Pages
Huge Pages, also known as Large Pages (on Windows) and Super Pages (on BSD or macOS) is very important thing for almost all supported CPU mineable algorithms, typical hashrate increase is 20-30% when huge pages used, for RandomX it can increase performance up to 50%. XMRig use term huge pages on all platforms, please don’t confusing.
If XMRig use huge pages you will see lines with text like bellow in miner log.
huge pages 100%
OS specific setup
Windows Linux Since version 5.2.0 if you run the miner with root privileges no manual system configuration required.
For manual configuration you must know how many huge pages you need, general recommendations is 1280 pages per NUMA node for RandomX algorithms and 128 per system for other algorithms. Please note 1280 pages means 2560 MB of memory will be reserved for huge pages and become not available for other usage, in automatic mode the miner reserve precise count of huge pages.
Temporary (until next reboot) reserve huge pages:
sudo sysctl -w vm.nr_hugepages=1280
Permanent huge pages reservation
sudo bash -c "echo vm.nr_hugepages=1280 >> /etc/sysctl.conf"
1GB huge pages Linux only
For RandomX dataset since version 5.2.0 the miner support 1GB huge pages (regular huge pages size is 2MB), this feature available only on Linux. It increases the hashrate by 1-3% (depends of CPU) and increases memory requirements to 3GB (3 pages) per NUMA node.
By default this feature disabled, to enable use option "1gb-pages": true,
in "randomx"
object.
If use XMRig with root privileges, additional system configuration not required.
As an alternative you can go to miner source directory and run sudo ./scripts/enable_1gb_pages.sh
script source .