How many threads should I use for XMRig?
Start with XMRig’s automatic thread settings, then test a few lower and higher counts to see what works best on your computer. More threads do not always mean more Monero: your CPU’s cache, memory speed, cooling, and other tasks all affect the best setting.
Use your CPU’s cache as a starting guide
A thread is one stream of work running on your CPU, your computer’s main processor. XMRig can run several mining threads at once, but each one needs enough resources to work efficiently.
Monero uses RandomX, a mining algorithm—a set of calculations—that favors CPUs. A useful starting rule is about 2 MB of L3 cache per mining thread. L3 cache is a small pool of very fast memory inside your CPU.
For example:
- 8 MB of L3 cache: Start around 4 mining threads.
- 16 MB of L3 cache: Start around 8 mining threads.
- 32 MB of L3 cache: Start around 16 threads, if your CPU has enough available processing threads.
Treat these as starting points, not guaranteed winners. Cache can be split between groups of cores, and some CPUs have cores with different capabilities. That can make a simple cache calculation less reliable than XMRig’s automatic setup.
Do not simply select every available thread
Your operating system may show more logical processors than physical cores. This comes from features called SMT or Hyper-Threading, which let a physical core handle two work streams.
Those extra streams share hardware. They do not double your CPU’s mining power.
For Monero mining, you might get the best result using one thread per physical core, fewer threads because cache is limited, or additional logical threads on a CPU with enough resources. There is no single rule that wins on every processor.
Memory matters too. RandomX fast mode uses a dataset of about 2,080 MB, plus cache and other memory. That dataset is normally shared by mining threads rather than copied for every thread. You still need spare RAM for your operating system and applications.
Test nearby settings and compare steady results
Let XMRig finish starting up before measuring anything. Its displayed hashrate—the number of mining calculations it performs each second—needs time to settle.
Use this simple process:
- Run the automatic configuration for about 10–15 minutes.
- Note the average hashrate, CPU temperature, and power use if you can measure it.
- Test one or two fewer threads under the same conditions.
- If resources allow, test one or two more.
- Repeat any close results with a longer run.
Keep other settings unchanged. In particular, keep huge pages, an operating-system memory feature that can improve RandomX performance, consistent between tests.
Do not judge a setting from one brief speed spike. Watch for heat-related slowdowns after the computer warms up.
Choose for how you use the computer
If you use the computer while mining, leave some CPU capacity available. Try reducing the mining thread count until browsing, calls, and other tasks feel normal.
For a dedicated machine you own, you can aim for the highest stable hashrate. But if electricity costs matter, a slightly lower thread count may produce nearly the same speed while using less power.
The bottom line
Use XMRig’s automatic settings first, then test nearby thread counts. Keep the setting that gives you the best sustained speed, power use, and responsiveness—not simply the largest number of threads.
