I am using xmrig as my miner. You can see the details in this link.

I am mining XMR with my cpu with more than one computer. And I've decided to check the results of my two different pcs' performances when I set their threads to different values. (You can see the options of the xmrig.exe in the link).

They both returned different performance rates(hash rates) depending on their number of threads.

Intel(R) Core(TM)i7-6700HQ CPU @ 2.60Ghz 2.60 Ghz

This one had the best performance with a thread number of 8 or 9 threads. They were both very close, around 96 h/s.

Intel(R) Core(TM)i7-4700HQ CPU @ 2.40Ghz 2.40 Ghz

This one had the best performance with a thread number of 5 threads. It hash rate was 130 h/s.

What is the reason behind this?

How can I learn how many threads I should set for different CPUs to get the best performance? I am sure people who are/will be running miners for long term might be wondering this too. How many threads for each different CPU? Also what are the factors that might affect the number of threads that we should be using?

up vote 4 down vote accepted

Each thread requires 2MiB of memory. That's because an instance of CryptoNight hash function requires a 2MiB scratchpad. If it can all fit in CPU cache it's way faster since RAM is very slow compared to CPU cache. So, divide your CPU cache with 2 and you'll get the optimal number of threads.

First, the input is hashed using Keccak [KECCAK] with parameters b = 1600 and c = 512. The bytes 0..31 of the Keccak final state are interpreted as an AES-256 key [AES] and expanded to 10 round keys. A scratchpad of 2097152 bytes (2 MiB) is allocated.

I'd expect you to achieve best results with 2 or 3 threads. If you already tried those, and are still getting better results with more then I don't know. The cache size is a thumb rule, but it could also depend on other low-level stuff which are understood by only a few.

You could also try xmr-stak and compare the results.

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.