How can I determine the optimal number of mining threads to start if I know the CPU and the quantity of RAM? Are other parameters relevant?


As a general rule of thumb: Cryptonight, the PoW hash Monero uses, needs a 2 MB scratchpad in fast memory, so you will want to have all your mining threads able to keep their scratchpad in cache. So the optimal number is likely to be your cache size divided by 2 MB (eg, if your cache size is 4 MB, then 2 threads). If that number happens to be higher of equal to the number of cores you have, then keep it to the number of cores minus one.

If you use the machine for other things at the same time, you will need to decrease that number, and by how much will have to be determined by testing.

In any case, you may want to test a number of configurations, testing is quick and easy, and will uncover any deviation your hardware may have from that rule of thumb.


I played around a bit with using different numbers of threads on different machines, and my best results came from just using half the number of cores on that machine. Here's part of my script to launch minerd on macOS:

numCores=$(sysctl hw.logicalcpu | awk '{print $2}')

((numCores = numCores / 2))

./minerd -a cryptonight -o stratum+tcp://$pool -u $miningWallet -p x -t $numCores

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.