How many threads should I use for XMRig on my CPU?
Start with XMRig’s automatic thread selection, then test a few lower settings to find what works best on your CPU. For Monero, using every available thread is not always faster: your CPU’s cache, memory speed, and cooling can limit the useful thread count.
Use your CPU’s cache as a starting guide
XMRig is a mining program that runs directly on your computer, rather than inside your browser. It mines Monero using RandomX, a mining algorithm designed to favor CPUs.
A mining thread is one worker running calculations on your CPU. For RandomX, allow roughly 2 MB of L3 cache per mining thread. L3 cache is a small, very fast storage area inside your processor.
For a rough starting limit, divide your CPU’s L3 cache in megabytes by two:
- 8 MB L3: try around 4 mining threads.
- 16 MB L3: try around 8 mining threads.
- 32 MB L3: try around 16 mining threads, if your CPU supports that many.
This is a starting guide, not a guarantee. Cache may be split between groups of cores, and other CPU resources can become bottlenecks. XMRig’s automatic selection considers more than just the advertised thread count, so it is usually a better first step than guessing.
Don’t confuse cores with advertised threads
A core is a physical processing unit. Many CPUs let each core handle two software threads using a feature called simultaneous multithreading, or Intel Hyper-Threading.
That means an “8-core, 16-thread” CPU has eight physical cores, not sixteen. Using sixteen mining threads can help on some processors, but it does not automatically double your speed.
For example, if your 8-core, 16-thread CPU has 16 MB of L3 cache, eight mining threads is a sensible starting point. If it has 32 MB, testing more than eight may be worthwhile.
On CPUs with a mixture of faster and smaller efficiency cores, thread placement matters too. Simply choosing the highest count may give disappointing results.
Test for your best real-world setting
Keep XMRig’s other settings unchanged while you compare thread counts. Let each test run for several minutes after startup, long enough for speed and temperature to settle.
Watch these measurements:
- Hashrate: mining calculations per second, usually shown as H/s.
- Power use: ideally measured at the wall outlet.
- Temperature and fan noise: especially during longer runs.
- Responsiveness: whether your normal tasks still feel smooth.
Try the automatic setting first, then reduce the count by one or two threads at a time. If your cache and CPU leave room, also test a slightly higher count.
Choose the count that matches your goal. The highest hashrate may use much more electricity for only a small speed gain. For a PC you also use daily, fewer mining threads can be the better choice.
Check memory and server layout
RandomX’s fast mode uses a dataset of about 2,080 MB, plus supporting memory. You do not need another 2 GB for every mining thread.
On servers with multiple CPU sockets, memory placement matters. Each processor works best with nearby memory; this arrangement is called NUMA, or non-uniform memory access. Keep XMRig’s NUMA support enabled unless testing shows a reason to change it.
The bottom line
Start with automatic selection, use roughly 2 MB of L3 cache per thread as a sanity check, and benchmark nearby counts. Your best setting delivers steady speed without excessive power use, heat, or disruption to your other work.
