So I am mining some coinage in the Cryptocurrency world. Mainly because the miners make GREAT performance testing resources. Nothing like maxing out CPU or GPU or both whenever you need it (and making a little speculative coin on the side).
But, Windows the mining program was doing me wrong. By default, the thread scheduler thing sets a new process to use ALL cores available and apparently go in sequence. This is ‘ok’ but I find I get MUCH better results when I don’t let the thread scheduler miner handle my CPU-based miner threads.
Case in point:
Note CPU #6. Why is it 70,000 hashes/second faster than it’s peers? Because it’s the only miner thread that doesn’t have it’s partner CPU also running at 100%.
Let’s look at this in Task Manager, this is what it looks like:
So see the pairings? CPU 0/1, CPU 2/3, CPU 4/5, CPU 6/idle.
That’s why CPU 6 can run faster. It’s hyper-threaded pair isn’t mussing it up. Plus it perhaps has better caching since it isn’t using pipeline cache for another busy thread (conjecture).
Anyway, changing this is trivial. I found my miner in task manager and right clicked it and selected Processor affinity.
See how it’s spread out on all CPUs? Yeah we’re going to fix that.
Now I’m using every odd CPU, and every even CPU is not used by my miner process. Fair enough. I am only allocating 7 miner threads by the way, so we’re giving the miner an extra thread. Who cares. It might not use it. Don’t care.
Hit ok and see the results:
See, CPU 0, 2, 4, 6 are falling. The odds are all increasing.
The results? Pretty damn good. I went from 990 kH/s on 7 mining threads to 1746 kH/s.
I’ll take it.
All this because Windows thread scheduling leaves something to be desired…since like, a while ago. But that’s another story…
Carl schooled me.
So, you’re running an application that’s not aware of HT (very obviously) and is probably doing actual scheduling by counting CPUs, versus letting the OS manage it.
Why are you saying that this is the OS’s fault? It’s HT-aware and would have been expected to execute a lower number of threads than physical cores on the available physical cores directly – unless told to otherwise to do so by the application. So, I guess I’m asking for a friend ;).
I’ll show you the app shortly. I am able to specify the amount of mining threads that go to 100% CPU yeah. Why does an app need to micromanage where they go, why can’t the HAL do that?
They don’t, at least not by default. Something is wrong with the app most likely telling Windows to do that, because by default it shouldn’t.