Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 6E51B63777A for ; Fri, 26 Feb 2010 03:01:56 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 30354-05-2 for ; Fri, 26 Feb 2010 07:01:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mail.postgresql.org (Postfix) with ESMTP id DC7A3637122 for ; Fri, 26 Feb 2010 03:01:37 -0400 (AST) Received: by pzk15 with SMTP id 15so60913pzk.20 for ; Thu, 25 Feb 2010 23:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IaDPXszDj29JJ5cz8Ia5ss4/vNJ/v5EjO+7qw6Qqb3g=; b=mw3VvH4dGwzqGAY5dZQoECaB6issGCvzk0HWbBmh/zWhi9jUBTiQdZsc3Ye/z4GoAN O4I6zm6SDSzB9nBFGdrn5GPxUw2Bax7/kSZUncVckT9uy0ZSB8r+gaGQUzm4KSl7QcgN mzrV8wdUkpuLREWZyEMh//P5x51SUg8pyoIvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=AYd3ABnHTlZ8xf5qqSdoIxCWv+WdtaOaVAfKofTqo7+wlAMYGUwm9PKExam2kuBsAm jthFDDUAQTxKvWOcxC9nqnoKokV2FB6GWDm+IQClDVwweKY1bU3gBbhlRjEaggYRocSg s5aMGLgCwMvxdymtMf3Nj8d2XSaPt2aauvWBY= MIME-Version: 1.0 Received: by 10.141.53.12 with SMTP id f12mr346465rvk.188.1267167696313; Thu, 25 Feb 2010 23:01:36 -0800 (PST) In-Reply-To: <1267166541.2094.52.camel@hp-laptop2.gunduz.org> References: <8a547c841002252212t382cfeb4pde3e668a9d3f2f10@mail.gmail.com> <1267166541.2094.52.camel@hp-laptop2.gunduz.org> Date: Thu, 25 Feb 2010 23:01:36 -0800 Message-ID: <8a547c841002252301g49d7f183ue0909929de09d20@mail.gmail.com> Subject: Re: bgwriter, checkpoints, curious (seeing delays) From: Tory M Blue To: =?ISO-8859-1?Q?Devrim_G=DCND=DCZ?= Cc: 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=-1.835 tagged_above=-10 required=5 tests=AWL=0.764, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/368 X-Sequence-Number: 37789 2010/2/25 Devrim G=DCND=DCZ : > On Thu, 2010-02-25 at 22:12 -0800, Tory M Blue wrote: >> shared_buffers =3D 1500MB > > Some people tend to increase this to 2.2GB(32-bit) or 4-6 GB (64 bit), > if needed. Please note that more shared_buffers will lead to more > pressure on bgwriter, but it also has lots of benefits, too. > >> work_mem =3D 100MB > > This is too much. Since you have 300 connections, you will probably swap > because of this setting, since each connection may use this much > work_mem. The rule of the thumb is to set this to a lower general value > (say, 1-2 MB), and set it per-query when needed. > >> checkpoint_segments =3D 100 >> checkpoint_warning =3D 3600s > > What about checkpoint_timeout? Please note that even if > checkpoint_segments =3D 100, if timeout value is low (say 5 mins), > PostgreSQL will probably checkpoint every checkpoint_timeout minutes > (unless PostgreSQL creates $checkpoint_segments xlogs before > checkpoint_timeout value). Depending on your workload, this may not be > intended, and it may cause spikes -- which will lead to the issues you > complain. > > I'll stop here, and suggest you read this: > > http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm > > for details about this subject. As noted there, if you are running 8.3+, > pg_stat_bgwriter will help you to tune checkpoint & bgwriter settings. > > -HTH. Checkpoint_timeout is the default and that looks like 5 mins (300 seconds). And is obviously why I have such a discrepancy between time reached and requested. Thank you sir, that's actually the page that I've spent much of my time on this eve :) I'll continue to read and check my configuration settings. Tory