Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 4BC1C9FB2DB for ; Mon, 28 May 2007 23:21:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 73392-08 for ; Mon, 28 May 2007 23:21:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 156E89FAA6E for ; Mon, 28 May 2007 23:21:54 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id l4T2LsqD003525 for ; Mon, 28 May 2007 22:21:54 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id l4T2Lslk003521 for ; Mon, 28 May 2007 22:21:54 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Mon, 28 May 2007 22:21:54 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: pgsql-patches@postgresql.org Subject: Re: Logging checkpoints and other slowdown causes In-Reply-To: <465B3ABB.6010709@enterprisedb.com> Message-ID: References: <200704030814.33999.peter_e@gmx.net> <46443F02.6060300@enterprisedb.com> <465B3ABB.6010709@enterprisedb.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/465 X-Sequence-Number: 2565 I'll take another stab at refining this can of worms I opened. The one thing I noticed on a quick review is that it's almost possible to skip all the calls to gettimeofday if log_checkpoints is off now. I'd like to make that a specific goal, because that will make me feel better that adding this code has almost no performance impact relative to now unless you turn the feature on. I agree with Simon that tracking create/drop separately is unnecessary. As for why all the timing info is in ms, given the scale of the numbers typically encountered I found it easier to work with. I originally wanted resolution down to 0.1ms if the underlying OS supports it, which means 4 figures to the right of the decimal point if the unit was switched to seconds. Quite often the times reported are less than 100ms, so you'll normally be dealing with fractional part of a second. If we take Heikki's example: LOG: checkpoint complete; buffers written=3.1 MB (9.6%) write=96.8 ms sync=32.0 ms And switch it to seconds: LOG: checkpoint complete; buffers written=3.1 MB (9.6%) write=0.0968 ms sync=0.0320 ms I don't find that as easy to work with. The only way a timing in seconds would look OK is if the resolution of the whole thing is reduced to ms, which then makes 3 decimal points--easy to read as ms instead. Having stared at a fair amount of this data now, that's probably fine; I'll collect up some more data on it from a fast server this week to confirm whether's it's worthless precision or worth capturing. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD