Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1DA8B643A84 for ; Tue, 16 Mar 2010 17:56:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05729-02 for ; Tue, 16 Mar 2010 20:56:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8]) by mail.postgresql.org (Postfix) with ESMTP id 0FDF765B13D for ; Tue, 16 Mar 2010 17:56:09 -0300 (ADT) Received: from [192.168.0.105] (pool-96-244-14-10.bltmmd.fios.verizon.net [96.244.14.10]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M03sS-1NWWPi2cgO-00u7SU; Tue, 16 Mar 2010 21:53:28 +0100 Message-ID: <4B9FEFC4.1020705@2ndquadrant.com> Date: Tue, 16 Mar 2010 16:53:24 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Greg Stark CC: Tom Lane , Pierre C , Dave Crooke , Paul McGarry , pgsql-performance@postgresql.org Subject: Re: shared_buffers advice References: <4B9F3302.4020900@2ndquadrant.com> <8285.1268749832@sss.pgh.pa.us> <407d949e1003160753o6e5faa48rabaa42f7548029b7@mail.gmail.com> In-Reply-To: <407d949e1003160753o6e5faa48rabaa42f7548029b7@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX18SAW3z0I3iYsbkNpR7jaKhKUUN3nqcBi/RjAM ztn+RidTojzSI618NKvwRvx9N/ck5RYYODLC7Su70V6EIduFq1 EED1E9d3qDjYH5TPTPpUuF/gd07eiDU X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/176 X-Sequence-Number: 38001 Greg Stark wrote: > On Tue, Mar 16, 2010 at 2:30 PM, Tom Lane wrote: > >> "Pierre C" writes: >> >>> Does PG issue checkpoint writes in "sorted" order ? >>> >> No. IIRC, a patch for that was submitted, and rejected because no >> significant performance improvement could be demonstrated. > If the OS filesystem buffer cache is really small then that might not > work so well. It might be worth rerunning those benchmarks on a > machine with shared buffers taking up all of RAM. > Here's the original patch again: http://archives.postgresql.org/message-id/20080415181742.6C97.52131E4D@oss.ntt.co.jp I was the person who tried to reproduce the suggested 10% pgbench speedup on a similar system and couldn't replicate any improvement. Never was sure what was going on to show such a difference on the reference system used to develop the patch versus mine, since they were pretty similar. Possibly some positive interaction with LVM in the test case I didn't have. Maybe the actual reason sorting helped was limitations in the HP P400 controller used there I wasn't running into with the Areca card I used. And the always popular "didn't account fully for all pgbench run to run variation" possibility crossed my mind too--that the original observed speedup wasn't caused by the patch but by something else. I did not go out of my way to find test conditions where the patch would more likely to help, like the situation you describe where shared_buffers was really large relative to the OS cache. Since the patch complicates the checkpoint code and requires some working memory to operate, it would have to be a unquestionable win using standard practices before it was worth applying. If it only helps in a situation people are unlikely to use in the field, and it net negative for everyone else, that's still going to end up on the interesting but rejected idea scrapheap at the end of the day. -- Greg Smith 2ndQuadrant US Baltimore, MD PostgreSQL Training, Services and Support greg@2ndQuadrant.com www.2ndQuadrant.us