I'm currently mining XMR on a dedicated server that has an Intel I7-4790K CPU. It has 4 cores/8 threads, and 8 MB of L3 cache. I'm using cpuminer-multi. This is a full node with the monero daemon running (I'm not sure whether this uses enough resources to decrease mining performance or not, maybe someone can tell me.)

I've been trying to figure out what the optimal number of threads is and have been researching it but can't find that much on it. Also, everyone says something different.

On some places I see that people recommend that the number of threads should ideally be the amount of L3 cache (in my case 8MB) divided by 2 (this would be 4 threads). Other people recommend that the number of threads be the same as the number of CPU cores (in my case 4).

What should I do? Does the number of threads actually make a difference? What is the default number of threads used if you don't specify it when you run cpuminer?

Just to give an idea, I have it currently running at 4 threads, with a hash rate of approximately 200 H/s. This number fluctuates quite a lot actually, but seems to mostly be between 200-300 H/s.


The correct answer is a combination of what you've read. The maximum number of threads you should ever try to use is the number of CPU cores. Each thread uses 2MB of RAM, so your best performance per-thread will be if you only use your cache size divided by 2MB. In your case, it appears that you get the same answer, 4 threads, either way.

Yes, the monerod will occasionally need to crunch thru 2MB as well when it validates incoming blocks. And it will consume bandwidth when relaying transactions and blocks to other nodes. So that will have some impact on your performance.

  • Thanks a lot! this made things clear. Just to clarify, by core you meant physical cores, right? and could you please explain how something like cpuminer-multi normally chooses the number of threads if you haven't specified it? – Salah Kayali Jan 17 '17 at 7:26
  • Yes, physical cores. The minerd.1 manpage already documents the default number of threads so I won't repeat it here. – hyc Jan 17 '17 at 15:19
  • Does it matter whether it's L2 or L3 cache? I'm using AMD Opteron 3365, and it has 8 MB for L2 + 8 MB for L3. What should the best configuration be here? – The Quantum Physicist Oct 31 '17 at 0:32
  • Measure it yourself and let us know. – hyc Oct 31 '17 at 18:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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