X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A6AC6329C70 for ; Thu, 23 Sep 2004 20:02:05 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40658-03 for ; Thu, 23 Sep 2004 19:02:02 +0000 (GMT) Received: from mail.copelandconsulting.net (dsl-24293-ld.customer.centurytel.net [209.142.135.135]) by svr1.postgresql.org (Postfix) with ESMTP id BEEB0329D9D for ; Thu, 23 Sep 2004 20:01:58 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by mail.copelandconsulting.net (Postfix) with ESMTP id E4F9EC000ED; Thu, 23 Sep 2004 14:01:57 -0500 (CDT) Received: from mail.copelandconsulting.net ([127.0.0.1]) by localhost (mouse.copelandconsulting.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06851-03; Thu, 23 Sep 2004 14:01:57 -0500 (CDT) Received: from [192.168.1.3] (shrew.copelandconsulting.net [192.168.1.3]) by mail.copelandconsulting.net (Postfix) with ESMTP id A070DC000E1; Thu, 23 Sep 2004 14:01:57 -0500 (CDT) Subject: Re: Hyper threading? From: Greg Copeland To: Mariusz =?iso-8859-2?Q?Czu=B3ada?= Cc: pgsql-performance@postgresql.org In-Reply-To: <200409211054.48574.manieq@idea.net.pl> References: <200409211054.48574.manieq@idea.net.pl> Content-Type: text/plain; charset=utf-8 Organization: Copeland Computer Consulting Message-Id: <1095966117.3422.12.camel@shrew.copelandconsulting.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-2.1.92mdk Date: Thu, 23 Sep 2004 14:01:57 -0500 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at copelandconsulting.net X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/253 X-Sequence-Number: 8381 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@copelandconsulting.net Copeland Computer Consulting 940.206.8004