Re: Hyper threading?

From: Greg Copeland <greg(at)copelandconsulting(dot)net>
To: Mariusz Czułada <manieq(at)idea(dot)net(dot)pl>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Hyper threading?
Date: 2004-09-23 19:01:57
Message-ID: 1095966117.3422.12.camel@shrew.copelandconsulting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, 2004-09-21 at 03:54, Mariusz Czułada wrote:
> Hi all,
>
> I searched list archives, but did not found anything about HT of Pentium
> 4/Xeon processors. I wonder if hyperthreading can boost or decrease
> performance. AFAIK for other commercial servers (msssql, oracle) official
> documents state something like "faster, but not always, so probably slower,
> unless faster". User opinions are generaly more clear: better swhitch off HT.
>
> Do you have any experiance or test results regarding hyperthreading? Or what
> additional conditions can make HT useful or pointless?
>

I think you'll find that HT is very sensitive to both the OS and the
application. Generally speaking, most consider HT to actually slow
things down, unless you can prove that your OS/application combination
is faster with HT enabled. Last I heard, most vendors specifically
disable HT in the BIOS because the defacto is to expect HT to inflict a
negative performance hit.

IIRC, one of critical paths for good HT performance is an OS that
understands how to schedule processes in a HT friendly manner (as in,
doesn't push processes from a virtual CPU to a different physical CPU,
etc). Secondly, applications which experience a lot of bad branch
predictions tend to do well. I don't recall what impact SSE
instructions have on the pipeline; but memory seems to recall that
applications which use a lot of SSE may be more HT friendly. At any
rate, the notion is, if you are HT'ing, and one application/thread
requires the pipeline to be flushed, the other HT'ing thread is free to
run while the new branch is populating cache, etc. Thusly, you get a
performance gain for the other thread when the CPU makes a bad guess.

Along these lines, I understand that Intel is planning better HT
implementation in the future, but as a general rule, people simply
expect too much from the current HT implementations. Accordingly, for
most applications, performance generally suffers because they don't tend
to fall into the corner cases where HT helps.

Long story short, the general rule is, slower unless you having proven
it to be faster.

Cheers,

--
Greg Copeland, Owner
greg(at)copelandconsulting(dot)net
Copeland Computer Consulting
940.206.8004

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-09-23 19:06:52 Re: Caching of Queries
Previous Message Josh Berkus 2004-09-23 18:56:31 Re: Caching of Queries