- Dec 21, 2015
- 843
- 235
- 116
I've been trying to determine if there is some way to determine when disabling hyperthreading will help performance? I assume it depends on what is running and how many cores the CPU has?
on Linux, leaving half of the logical CPUs unused while HT/SMT is enabled gives you practically the same result as if you disabled HT/SMT in the BIOS.disabling hyperthreading
The only workloads that I use that I really need maximum CPU performance are gaming and Handbrake. This is mostly in relationhip to XEON's. They are all quad channel memory so I assume memory bandwidth is not a limiting factor. I can test Handbrake. I know it uses 8 cores at 100% but not 12. Neither my E5-2695 V2 or 5900x scale unless I do two encodes at the same time. Is there software that can tell me the number of threads something is using? Unfortunately, my E5-2695 V2 Windows install decided to get corrupted so I have to fix that before I can bench it with hyperthreading disabled.Benchmarking your particular workload on your particular hardware would be the ideal way.
Given a parallel workload, consisting of several processes/ several program instances (maybe, but not necessarily, in several containers or VMs), a first question would be if the available RAM bandwidth is enough for all the instances, or even better, if the present CPU cache size is enough for the number of instances. If not, run fewer concurrent instances if you can; obviously.
Then, if each workload instance is multi-threaded, next questions would be (a) on the software side/ data side, to which thread count the instance can scale without incurring unacceptable overhead, (b) how many threads are needed in order to sustain good utilization of your CPUs' execution units.
And then we are, en passant, getting to the topic of HyperThreading or SMT. After the points made above, it depends on the instruction profile of your workload on the one hand, and on the architecture of your CPUs on the other hand — and sometimes on whether performance or power efficiency is your priority — whether or not HyperThreading or SMT is beneficial in your workload–hardware combo.
(By "hardware" I also am implying its particular settings, e.g. fixed clock or fixed power limit, and at what levels.)