Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8D377B5DBE3 for ; Tue, 11 Oct 2011 05:58:05 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 56379-04 for ; Tue, 11 Oct 2011 08:57:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from nm17-vm0.bullet.mail.ird.yahoo.com (nm17-vm0.bullet.mail.ird.yahoo.com [77.238.189.214]) by mail.postgresql.org (Postfix) with SMTP id D7714B5DBDE for ; Tue, 11 Oct 2011 05:57:58 -0300 (ADT) Received: from [77.238.189.52] by nm17.bullet.mail.ird.yahoo.com with NNFMP; 11 Oct 2011 08:57:57 -0000 Received: from [212.82.108.118] by tm5.bullet.mail.ird.yahoo.com with NNFMP; 11 Oct 2011 08:57:57 -0000 Received: from [127.0.0.1] by omp1027.mail.ird.yahoo.com with NNFMP; 11 Oct 2011 08:57:57 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 936280.26337.bm@omp1027.mail.ird.yahoo.com Received: (qmail 19907 invoked by uid 60001); 11 Oct 2011 08:57:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s1024; t=1318323477; bh=9ctun79FMgrZTUtkfEPB7+cS1jeHjwv7Dvc1E2WCAlg=; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=D+ZxWDggMEqwnJ43NA5ThZJT154BrYC+VjWrmKUcFuwv1RbUWHFaY6Y1drmhgiH4Vn9eDaDqUk+vEVmO7Xu44Rwu1Hi1n49pMLKEwGR2N0ybn9osKxbaqArgE8TcqnHChNh/pAxtAX27Sdm2a9n8RdNxXMW3EzVbqsq1b2F5Ldo= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.it; h=X-YMail-OSG:Received:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=QVkVyCtR6VprzUNQrglLx11Z2SFpLoFBqUXzvfXa8dyilsH68uux4aVyzNilSkZxxj8MSPfQzgLkkf69D8/vKbNK4NgLjJ1PXGnPt7VxmDTLHkksYkv1NVj/qbakHM+TWGs9KPNCweOYZ9/57jfzGa4uuh/BvSbOkEhROcHH95Q=; X-YMail-OSG: X6826CAVM1mRN7dnHJHkk5_wibTq_OSnr925qHxy57J8e.J xGpylyCjwWmv_xNreWuC4sVygZG7UVuECtYg7hARM1mZTbotKS7b2FuJRCGd bgQmpl7dgqBKU4hyQ23vtd.6I1u_pS46BjGvyZkvMYZYZTCsMSHiD1_FmMAJ kyQz9IB1jiDSWI6B65e0KBuZgEqWe0hQouJwCST3WDh9YpDAztLpKdz5ez29 jGRvv_NGVBRRQbf61LNqFAiBWF7gFlDTBWe_Vv7PE3LwClT_k34.jwex3ypg 9uKzg63Ys0gX2hy94gLSG3fhHjwybpLg9W8Dze4C4zBoqiy7rZTeOleLPFWG 9j410GoMoVGg38a1kjISk3C3aVGdj_nQPO3fUSjr04pIJ61PMLXzRI3LXnI_ v9Ms- Received: from [85.33.62.89] by web29005.mail.ird.yahoo.com via HTTP; Tue, 11 Oct 2011 09:57:57 BST X-Mailer: YahooMailWebService/0.8.114.317681 References: <4E92F294.9010405@gmail.com> <4E92FB87.1030703@peak6.com> <1318259675.10344.YahooMailNeo@web29011.mail.ird.yahoo.com> <4E93119C.8090407@peak6.com> <1318263277.56967.YahooMailNeo@web29013.mail.ird.yahoo.com> <4E93E746.10807@2ndQuadrant.com> Message-ID: <1318323477.19815.YahooMailNeo@web29005.mail.ird.yahoo.com> Date: Tue, 11 Oct 2011 09:57:57 +0100 (BST) From: Leonardo Francalanci Reply-To: Leonardo Francalanci Subject: Re: Adding more memory = hugh cpu load To: Greg Smith , "pgsql-performance@postgresql.org" In-Reply-To: <4E93E746.10807@2ndQuadrant.com> MIME-Version: 1.0 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=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201110/95 X-Sequence-Number: 45317 > checkpoint_completion_targets spreads out the writes to disk.=A0 PostgreS= QL=A0=0A=0A> doesn't make any attempt yet to spread out the sync calls.=A0 = On a busy =0A> server, what can happen is that the whole OS write cache fil= ls with dirty =0A> data--none of which is written out to disk because of th= e high kernel =0A> threshold--and then it all slams onto disk fast once the= checkpoint starts =0A> executing sync calls.=A0 Lowering the size of the L= inux write cache helps with =0A> that a lot, but can't quite eliminate the = problem.=0A=0A=0AOk, I understand now=0A=0A> Except that PostgreSQL doesn't= look after the fsync calls yet.=A0 I wrote a=A0=0A=0A> patch for 9.1 that = spread out the sync calls, similarly to how the writes are =0A> spread out = now.=A0 I wasn't able to prove an improvement sufficient to commit =0A> the= result.=A0 In the Linux case, the OS has more information to work with abo= ut =0A> how to schedule I/O efficiently given how the hardware is acting, a= nd it's =0A> not possible for PostgreSQL to know all that--not without dupl= icating a large =0A> portion of the kernel development work at least.=A0 Ri= ght now, relying the kernel =0A> means that any improvements there magicall= y apply to any PostgreSQL version.=A0 So =0A> far the results there have be= en beating out improvements made to the database =0A> fast enough that it's= hard to innovate in this area within Postgres.=0A=0A=0AOk; thank you very = much for the explanation.=0A=0AIn fact, shouldn't those things be explained= in the "WAL Configuration" section=0Aof the manual? It looks as important = as configuring Postgresql itself...=0AAnd: that applies to Linux. What abou= t other OS, such as Solaris and FreeBSD?