Re: Performance under contention

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Ivan Voras <ivoras(at)freebsd(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance under contention
Date: 2010-11-26 02:00:29
Message-ID: 4CEF14BD.7060104@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ivan Voras wrote:
> PostgreSQL 9.0.1, 10 GB shared buffers, using pgbench with a scale
> factor of 500 (7.5 GB database)
>
> with pgbench -S (SELECT-queries only) the performance curve is:
>
> -c# result
> 4 33549
> 8 64864
> 12 79491
> 16 79887
> 20 66957
> 24 52576
> 28 50406
> 32 49491
> 40 45535
> 50 39499
> 75 29415

Two suggestions to improve your results here:

1) Don't set shared_buffers to 10GB. There are some known issues with
large settings for that which may or may not be impacting your results.
Try 4GB instead, just to make sure you're not even on the edge of that area.

2) pgbench itself is known to become a bottleneck when running with lots
of clients. You should be using the "-j" option to spawn multiple
workers, probably 12 of them (one per core), to make some of this go
away. On the system I saw the most improvement here, I got a 15-25%
gain having more workers at the higher client counts.

> The "sbwait" part is from FreeBSD - IPC sockets, but so much blocking
> on semwait indicates large contention in PostgreSQL.

It will be interesting to see if that's different after the changes
suggested above.

--
Greg Smith 2ndQuadrant US greg(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services and Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ivan Voras 2010-11-26 02:08:30 Re: Performance under contention
Previous Message tv 2010-11-25 15:46:33 Re: Which gives good performance? separate database vs separate schema