Operating System - Linux
1819791 Members
3282 Online
109607 Solutions
New Discussion юеВ

hyperthreading vs no. processors vs performance

 
John Mannion
Occasional Advisor

hyperthreading vs no. processors vs performance

I have heard that as you increase the no. of
processors on an SMP box, the amount of performance gain from hyperthreading decreases.
With 8 physical processors, the actual gain is only 0 - 5%.

Given this, is there any point at which hyperthreading could actually decrease
performance and should therefore be disabled ?

Thanks

John
3 REPLIES 3
Dave Falloon
Trusted Contributor

Re: hyperthreading vs no. processors vs performance

This decrease is processing power is due to the management overhead. Its the law of diminishing returns, with each addition of complexity gains are reduced.

One thing people neglect to tell you when discussing multiprocessor machines, hyperthreading, dual cores, etc. is the fact that your application must make use of multiple threads for any additional processors to make a difference. The OS will take advantage of the extra processors as far as cpu cycle slices but it will not make a difference in the speed of a single thread application. The processors speed determines how fast an operation completes.

The other side of the coin is the hyperthreading benchmarks have been ALL OVER the place, and mostly seem to relate to versions of libraries and kernel patch levels and gcc compile time options, this makes sense as hyper threading is relatively new and the code base for it is still expanding, but it leaves a lot of room for error in planning your system, OS versions now affect the processor utilization.

I personally doubt that there is a system available for purchase today that has enough processor slots open that would allow you to hit the point where management overhead from hyperthreading would become detremental to the overall function of the machine. Kernel version and the applications intelligent use of threads will have more impact.

--Dave
Clothes make the man, Naked people have little to no effect on society
C. Beerse
New Member

Re: hyperthreading vs no. processors vs performance

It greatly depends on what the machine is doing. If it is mainly i/o, then there is not much gain. If the machine is doing numbercrunching, then the gain can be (almost) up to the number of processes.

If you have 6 processes fighting for the cpu on a single cpu machine, adding a second cpu will boot performance: the 6 processes now fight for 2 cpus.

If you switch from a sinlge-core to a multi-core cpu, the boost will be less than switching to multiple real processors since the cpus share the same socket and hence each have less bandwith with the outside world.

If you switch from single thread to multi thread, the boost will be even less than multi-core would be since the cpus now also share the same cache (and other parts of the cpu).

In the end, there is always the more overhead in the os from the more (logical) cpus it sees.

My idea is to have the number of logicalcpu-s just around the number of processes that are actually using the cpu. On most unix machines, this is represented by the load of the machine. If it is worth having more load than cpus or more cpus than load is to be seen at the system itself.
Florian Heigl (new acc)
Honored Contributor

Re: hyperthreading vs no. processors vs performance

with 8 processors the impact of the cpu's 2nd-level cache is very high because the memory access bandwith tends to be an issue.

with hyperthreading the chance of cache flushing is higher, so You might end up loosing performance. :/
yesterday I stood at the edge. Today I'm one step ahead.