Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D605965ACB1 for ; Tue, 16 Mar 2010 11:54:10 -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 26831-09 for ; Tue, 16 Mar 2010 14:53:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pw0-f46.google.com (mail-pw0-f46.google.com [209.85.160.46]) by mail.postgresql.org (Postfix) with ESMTP id 4CE32635589 for ; Tue, 16 Mar 2010 11:54:00 -0300 (ADT) Received: by pwi1 with SMTP id 1so22271pwi.19 for ; Tue, 16 Mar 2010 07:53:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=t6TNnrbxmit00aI7wJJNwI56fIDqrBAIP9RZFD1k8YM=; b=ZbF43cnz+PnOGwH2yfGmhXQhJSQFjskBHBxuulGNA5eEuJsBWOF/LktiQLAhgShZdT ebz7FqLL6WxgtW8zjqdwaLVsaBPR/wDDNSo9U5O/l/VEvoJKB0Uq+qytbkJrKWar3G2P /OpLAf9JW/mzuNm46ezZgLDMngqF6PlYq6R9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=fFkfdDTvg2kkTxVmzD6BoxGUJgwnBnpdVleIAoGYxUy9OjYt9AFY7tn5fUbqPIMeIS w04f5IowzK7/FdhAXQ2bu4EQCyH+jj7SHKcJruZJsoSn74vHeqqubqXN3lYYnfPz/IAB 5mlu1I0BB1sy2MQFXURf6ViBgJT+DgTpP2aNc= MIME-Version: 1.0 Received: by 10.141.14.6 with SMTP id r6mr6851rvi.280.1268751238091; Tue, 16 Mar 2010 07:53:58 -0700 (PDT) In-Reply-To: <8285.1268749832@sss.pgh.pa.us> References: <4B9F3302.4020900@2ndquadrant.com> <8285.1268749832@sss.pgh.pa.us> From: Greg Stark Date: Tue, 16 Mar 2010 14:53:38 +0000 X-Google-Sender-Auth: 8d552fc70cbffeed Message-ID: <407d949e1003160753o6e5faa48rabaa42f7548029b7@mail.gmail.com> Subject: Re: shared_buffers advice To: Tom Lane Cc: Pierre C , Greg Smith , Dave Crooke , Paul McGarry , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/169 X-Sequence-Number: 37994 On Tue, Mar 16, 2010 at 2:30 PM, Tom Lane wrote: > "Pierre C" writes: >> Does PG issue checkpoint writes in "sorted" order ? > > No. =A0IIRC, a patch for that was submitted, and rejected because no > significant performance improvement could be demonstrated. =A0We don't > have enough information about the actual on-disk layout to be very > intelligent about this, so it's better to just issue the writes and > let the OS sort them. Keep in mind that postgres is issuing writes to the OS buffer cache. It defers fsyncing the files as late as it can in the hopes that most of those buffers will be written out by the OS before then. That gives the OS a long time window in which to flush them out in whatever order and whatever schedule is most convenient. 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. --=20 greg