pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Merlin Moncure <mmoncure@gmail.com>
To: Glyn Astill <glynastill@yahoo.co.uk>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: david@lang.hm, Steve Clark <sclark@netwolves.com>
Cc: Joshua D. Drake <jd@commandprompt.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Linux: more cores = less concurrency.
Date: Tue, 12 Apr 2011 08:24:34 -0500
Message-ID: <BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikwBskj8jF9JNYm6+=mQiXe1HRO7w@mail.gmail.com>
References: <BANLkTi=p=7CaidNh9M1gW7MUmk+UwBO19A@mail.gmail.com>
	<768150.83213.qm@web26002.mail.ukl.yahoo.com>
	<BANLkTikwBskj8jF9JNYm6+=mQiXe1HRO7w@mail.gmail.com>

On Tue, Apr 12, 2011 at 8:23 AM, Merlin Moncure <mmoncure@gmail.com> wrote:
> On Tue, Apr 12, 2011 at 3:54 AM, Glyn Astill <glynastill@yahoo.co.uk> wrote:
>> --- On Tue, 12/4/11, Merlin Moncure <mmoncure@gmail.com> wrote:
>>
>>> >> The issue I'm seeing is that 8 real cores
>>> outperform 16 real
>>> >> cores, which outperform 32 real cores under high
>>> concurrency.
>>> >
>>> > With every benchmark I've done of PostgreSQL, the
>>> "knee" in the
>>> > performance graph comes right around ((2 * cores) +
>>> > effective_spindle_count).  With the database fully
>>> cached (as I
>>> > believe you mentioned), effective_spindle_count is
>>> zero.  If you
>>> > don't use a connection pool to limit active
>>> transactions to the
>>> > number from that formula, performance drops off.  The
>>> more CPUs you
>>> > have, the sharper the drop after the knee.
>>>
>>> I was about to say something similar with some canned
>>> advice to use a
>>> connection pooler to control this.  However, OP
>>> scaling is more or
>>> less topping out at cores / 4...yikes!.  Here are my
>>> suspicions in
>>> rough order:
>>>
>>> 1. There is scaling problem in client/network/etc.
>>> Trivially
>>> disproved, convert the test to pgbench -f and post results
>>> 2. The test is in fact i/o bound. Scaling is going to be
>>> hardware/kernel determined.  Can we see
>>> iostat/vmstat/top snipped
>>> during test run?  Maybe no-op is burning you?
>>
>> This is during my 80 clients test, this is a point at which the performance is well below that of the same machine limited to 8 cores.
>>
>> http://www.privatepaste.com/dc131ff26e
>>
>>> 3. Locking/concurrency issue in heavy_seat_function()
>>> (source for
>>> that?)  how much writing does it do?
>>>
>>
>> No writing afaik - its a select with a few joins and subqueries - I'm pretty sure it's not writing out temp data either, but all clients are after the same data in the test - maybe theres some locks there?
>>
>>> Can we see some iobound and cpubound pgbench runs on both
>>> servers?
>>>
>>
>> Of course, I'll post when I've gotten to that.
>
> Ok, there's no writing going on -- so the i/o tets aren't necessary.
> Context switches are also not too high -- the problem is likely in
> postgres or on your end.
>
> However, I Would still like to see:
> pgbench select only tests:
> pgbench -i -s 1
> pgbench -S -c 8 -t 500
> pgbench -S -c 32 -t 500
> pgbench -S -c 80 -t 500
>
> pgbench -i -s 500
> pgbench -S -c 8 -t 500
> pgbench -S -c 32 -t 500
> pgbench -S -c 80 -t 500
>
> write out bench.sql with:
> begin;
> select * from heavy_seat_function();
> select * from heavy_seat_function();
> commit;
>
> pgbench -n bench.sql -c 8 -t 500
> pgbench -n bench.sql -c 8 -t 500
> pgbench -n bench.sql -c 8 -t 500

whoops:
pgbench -n bench.sql -c 8 -t 500
pgbench -n bench.sql -c 32 -t 500
pgbench -n bench.sql -c 80 -t 500

merlin



view thread (51+ messages)  latest in thread

Message-ID: <BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com>
Permalink:  ../BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: mmoncure@gmail.com, glynastill@yahoo.co.uk, Kevin.Grittner@wicourts.gov, sclark@netwolves.com, jd@commandprompt.com, scott.marlowe@gmail.com
  Subject: Re: Linux: more cores = less concurrency.
  In-Reply-To: <BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com>
  References: <BANLkTi=p=7CaidNh9M1gW7MUmk+UwBO19A@mail.gmail.com> <768150.83213.qm@web26002.mail.ukl.yahoo.com> <BANLkTikwBskj8jF9JNYm6+=mQiXe1HRO7w@mail.gmail.com> <BANLkTine3A9UUT4oYHTNA1tpda6ZtAmZ-A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox