Re: Linux: more cores = less concurrency. - Mailing list pgsql-performance

From david@lang.hm
Subject Re: Linux: more cores = less concurrency.
Date
Msg-id alpine.DEB.2.00.1104111259350.32165@asgard.lang.hm
Whole thread Raw
In response to Re: Linux: more cores = less concurrency.  (Steve Clark <sclark@netwolves.com>)
Responses Re: Linux: more cores = less concurrency.
List pgsql-performance
On Mon, 11 Apr 2011, Steve Clark wrote:

> On 04/11/2011 02:32 PM, Scott Marlowe wrote:
>> On Mon, Apr 11, 2011 at 12:12 PM, Joshua D. Drake<jd@commandprompt.com>
>> wrote:
>>> On Mon, 11 Apr 2011 13:09:15 -0500, "Kevin Grittner"
>>> <Kevin.Grittner@wicourts.gov>  wrote:
>>>> Glyn Astill<glynastill@yahoo.co.uk>  wrote:
>>>>
>>>>> The new server uses 4 x 8 core Xeon X7550 CPUs at 2Ghz
>>>> Which has hyperthreading.
>>>>
>>>>> our current servers are 2 x 4 core Xeon E5320 CPUs at 2Ghz.
>>>> Which doesn't have hyperthreading.
>>>>
>>>> PostgreSQL often performs worse with hyperthreading than without.
>>>> Have you turned HT off on your new machine?  If not, I would start
>>>> there.
> Anyone know the reason for that?

hyperthreads are not real cores.

they make the assumption that you aren't fully using the core (because it
is stalled waiting for memory or something like that) and context-switches
you to a different set of registers, but useing the same computational
resources for your extra 'core'

for some applications, this works well, but for others it can be a very
significant performance hit. (IIRC, this ranges from +60% to -30% or so in
benchmarks).

Intel has wonderful marketing and has managed to convince people that HT
cores are real cores, but 16 real cores will outperform 8 real cores + 8
HT 'fake' cores every time. the 16 real cores will eat more power, be more
expensive, etc so you are paying for the performance.

in your case, try your new servers without hyperthreading. you will end up
with a 4x4 core system, which should handily outperform the 2x4 core
system you are replacing.

the limit isn't 8 cores, it's that the hyperthreaded cores don't work well
with the postgres access patterns.

David Lang

pgsql-performance by date:

Previous
From: Glyn Astill
Date:
Subject: Re: Linux: more cores = less concurrency.
Next
From: Scott Marlowe
Date:
Subject: Re: Linux: more cores = less concurrency.