Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 71B061337B98 for ; Thu, 25 Nov 2010 22:00:47 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 58314-05 for ; Fri, 26 Nov 2010 02:00:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mail.postgresql.org (Postfix) with ESMTP id 74AB61337B66 for ; Thu, 25 Nov 2010 22:00:34 -0400 (AST) Received: from [192.168.1.6] (static-71-179-240-8.bltmmd.fios.verizon.net [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LtDrP-1OJQk01Py7-012Wl9; Fri, 26 Nov 2010 03:00:31 +0100 Message-ID: <4CEF14BD.7060104@2ndquadrant.com> Date: Thu, 25 Nov 2010 21:00:29 -0500 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Ivan Voras CC: pgsql-performance@postgresql.org Subject: Re: Performance under contention References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:h+46r7oq5hdmpYfQYQfcD8/a36U/EAtjQlLPL5TRQT/ PkjXCRvNs/EUR/5Ygid+6gw4iVFEgXLxRjN8tRNo8gTS9k+GrI DL+M8n0fNyBKOnZCXtL64IKTzuf+7WIPIhBcJ9P24hw1JaO+eQ L2lR2aZL5e0hZWs0TbT13zVxPh4xhTCjt2IwD6MtmhF2o9hcTI 8YPZPYl9DAKKw0vtRCxFyRkD6YH6xrSH4W0Ptj883Y= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201011/377 X-Sequence-Number: 41401 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@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services and Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books