Learn how to configure XMRig for maximum mining of Monero and other algorithms. We’ll cover huge pages, MSR mode, thread selection, proper config.json formatting, and tips on where to store mined XMR.
Why optimize the XMRig miner at all?
Let’s be honest: in the era of obscure Telegram channels and frantic TikToks, the idea of sitting at a computer and tweaking the settings of “some program” seems a bit boring. But let’s talk heart to heart. When it comes to mining Monero or other “secret” coins, every pair of hashes is literally your money. And that’s where XMRig comes in, our unsung hero, who can either work quietly or give the competition a run for its money. Configuring it to get the most out of your hardware is a science, or even an art.
“XMRig is a high-performance, open-source, cross-platform RandomX, CryptoNight, and Argon2 CPU/GPU miner,” says crazy-mining.org.
Yes, that’s the same website where the MSR mod yielded a 5-15% boost on Ryzen and up to 5% on Intel. And the crypto-mining.blog team adds that implementing 1 GB of pages in Linux increases the hashrate by an additional 1-3% and automatically disables hardware prefetchers on Intel, eliminating the need to fiddle with the BIOS. It sounds small, but in the long run, these are the percentages that make the difference.
In this article, we avoid the boring “introduction, main body, conclusion” formula. Instead, we’ll take you on a journey: from understanding how RandomX juggles memory to real-world configurations and even the issue of storing mined coins (for GUI wallets and mobile apps). Everything is presented in a lively, conversational style, with a touch of humor and a touch of humor.
🧠 Memory is more important than it seems
RandomX is a memory-hungry algorithm. It consumes approximately 256 KB of L2 cache and 2 MB of L3 cache per thread . Therefore, XMRig automatically limits the number of threads to avoid cache starvation. On Windows, a mere 4 GB of system memory can prove to be a bottleneck. An article on miner.download emphasizes that DDR3 is limited to 1500–2000 H/s per channel , while DDR4 is limited to approximately 4000–6000 H/s. These aren’t just numbers: trying to squeeze more will lead to throttling and crashes.
🚀 Why you should enable huge pages
The secret to RandomX’s efficiency is its use of Huge Pages. By default, the system divides memory into 4 KB blocks, but RandomX performs better with 2 MB and even 1 GB blocks. “Huge Pages increase RandomX performance by up to 50%,” and enabling 1 GB pages on Linux adds another 1-3%. On Windows, you’ll need the SeLockMemoryPrivilege privilege or run the miner as administrator and reboot. On Linux, page allocation is achieved with the command sudo sysctl -w vm.nr_hugepages=1280and edit /etc/sysctl.conf.
Incidentally, starting with XMRig v5.2.0, miner.download and crypto-mining.blog report that support for 1 GB huge pages"randomx-1gb-pages": true can be enabled via the [or] command line parameter --randomx-1gb-pages. Note: not all processors and kernels support such pages, and you may need to modify the GRUB bootloader parameters.
🛠️ Light and NUMA mode
If your server has multiple CPUs, RandomX creates a separate dataset for each NUMA node. Disabling NUMA (option "numa": false) reduces the number of datasets and memory consumption, but also results in a decrease in hashrate. There’s also a light mode , which reduces memory to 256 MB but significantly reduces speed. Use it only on low-power devices like the Raspberry Pi.
🔧 MSR mod and disabling prefetchers
RandomX randomly tweaks memory regions, so the CPU hardware prefetcher only gets in the way. The official XMRig guide recommends disabling the hardware prefetcher via the BIOS or using the MSR mod. Newer versions of XMRig automatically write the required values to the MSR registers when running with administrator privileges, and a line will appear in the log msr register values ... set successfully. This is a free boost; the community reports a speedup of up to 30% on an Intel i7-7700K. The author of crazy-mining.org also measured the effect: his Pentium G5400 overclocked from 1286 to 1340 h/s (+4.2%) .
Note: Some systems require disabling Secure Boot, and early-generation Ryzen systems require writing separate sets of the wrmsr register to prevent an error disabling opcache instructions. If you’re afraid to mess around, enable the "wrmsr": truedefault setting—XMRig will do the rest.
🎛️ Selecting the number of threads and priorities
One of the easiest ways to increase your profit is to choose the right number of threads. In the XMRig configuration file, cpuyou can specify "threads"“cores” and “priority” in the section. The official XMRig documentation explains that this parameter --threadsdetermines the number of threads and --cpu-affinityassigns them to specific cores. This parameter --cpu-prioritycontrols the priority class (from 0 (idle) to 5 (highest): increasing the priority will allow the miner to consume more resources, but may slow down other processes.
Real-world practice: on most Ryzen, it’s optimal to use a number of threads equal to the number of physical cores (not logical ones) to avoid cache exhaustion. On some dual-processor Xeons, you’ll need to experiment: experienced miners reduce the number of threads to half and achieve higher hashrate due to each thread receiving more cache. Adjust "cpu-max-threads-hint": 75or 50to allow XMRig to automatically adjust to your hardware.
If you’re mining on a GPU, instead of a block, cpuyou’ll fill in cuda[or opencl]. In these sections, you can specify [ "bfactor"and] "bsleep"for load balancing, as well as enable asmoptimizations ( auto, intel, ryzen, bulldozer). Keep in mind: assembly optimizations can provide significant performance gains on Zen2 and Zen3, but sometimes cause instability.
📁 Config.json or command line?
All the settings discussed are more conveniently configured via a file config.json. A JSON configuration file is the preferred configuration method, as it is more flexible and user-friendly . and emphasize that the command line does not cover all capabilities and that important parameters can be changed on the fly via the API .
Your path might look like this:
- Run XMRig with the key
--dry-runor via the wizard at xmrig.com/wizard to generate the startupconfig.json. - Open the resulting file in a text editor. In the block
cpu, specify an array of threads with the parameterslow_power_mode,no_prefetch,affinity,priority. Here, we’ll only use even cores, disable the prefetcher for each thread, and enable huge pages. - In the section
randomx, add"1gb-pages": truefor Linux and"wrmsr": truefor automatic MSR mode. If you have a single processor, leave it"numa": true.
For example:
"cpu": {
"enabled": true,
"huge_pages": true,
"hw-aes": null,
"priority": 4,
"max_threads_hints": 75,
"threads": [
{"index": 0, "low_power_mode": false, "no_prefetch": true, "affinity": 0},
{"index": 2, "low_power_mode": false, "no_prefetch": true, "affinity": 2}
]
}⚙️ Non-obvious settings and features of XMRig
- Pool and ports. Choose a reliable pool with low latency; this parameter
--keepalivewill help avoid timeouts. Hashrate can drop more due to network latency than to miner settings. - Background mode. The key
--backgroundallows you to run the miner as a daemon. However, make sure it doesn’t start before hugepages is enabled. - Autostart and donation level. By default, XMRig donates 1% of its power to developers. You can reduce the donation via [ ]
--donate-level=0.5, but a complete shutdown is not recommended—the project is actively developing. - Cache QoS. This experimental feature
--randomx-cache-qosblocks unauthorized processes from accessing the L3 cache, which can improve stability and speed. On server systems with noisy neighbors (such as virtualization or containers), this can improve hashrate.
📦 Where to store XMR? A little about wallets
Miner optimization is only half the story. reminds everyone that Monero is a limitless and anonymous cryptocurrency that emerged in 2014, and that it needs to be stored wisely . The site lists the best wallets, from the Monero GUI Wallet for PC, which requires downloading the blockchain but only stores one-third of its size, to the lightweight mobile Cake Wallet with support for XMR, BTC, and LTC. There are options for console fans ( CLI Wallet ), Android lovers ( Monerujo ), and multi-wallets like Edge .
Why is this important? Because holding XMR in a secure wallet is sometimes more profitable than selling it outright. Remember how in TV shows, the hero saves money by finding a hiding place under the floor. Your coins deserve the best hiding place.
🎤 Conclusion with a digression
Was this article weird? Perhaps. We started in the middle, jumping from huge pages to mobile wallets, and even reminiscing about TikTok and BIOS. But that’s the life of a miner—it’s made up of a lot of little details. Properly setting up XMRig is a delicate balance between hardware, software, and your patience. Disable prefetcher, enable huge pages, select threads, adjust the configuration, and don’t forget about coin storage security. And if at some point you want to quit and go grow tomatoes, no one will judge you. The main thing is to have enough XMR for the seeds.







