Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 9AC349FC222 for ; Fri, 11 May 2007 12:37:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 30322-07 for ; Fri, 11 May 2007 12:37:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id 7B1B49FC221 for ; Fri, 11 May 2007 12:37:51 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id k3so626437ugf for ; Fri, 11 May 2007 08:37:50 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=sQlUHm1798wvbNxGW5ZFDDuEyqQ3eEeVQy3RDzyCBXWO9+MxR/ZM6gc4xgheHhmJi2xAAetfXUuxkqRmj1fvh2jDMLXQTQmrNpFmrByGL5jWaymcGo3S9ftSPKxpMG9P36311CsMvG4VEvkrUt6/CVisghsQQRRUiA5H93Dalxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=SY6o+m19lbPw17teWzoKwDiiCoqsAmUVz42Fi5Yirs04UiYlITq9MNexIASGEMuf3SfCrc03e1ZNdOut0+xbH2cvc4hjoofSzWgVpJrQ8v1EkgBXOA+JyIU8HcPYjsvQBJWoFmH6KrrvGmO2uC2eCVXHIBAABbojlrtxN0tCoG0= Received: by 10.67.96.14 with SMTP id y14mr1957902ugl.1178897870579; Fri, 11 May 2007 08:37:50 -0700 (PDT) Received: from ?192.168.1.33? ( [82.3.68.110]) by mx.google.com with ESMTP id 20sm6241740uga.2007.05.11.08.37.46; Fri, 11 May 2007 08:37:48 -0700 (PDT) Message-ID: <46448DC8.4050102@enterprisedb.com> Date: Fri, 11 May 2007 16:37:44 +0100 From: Heikki Linnakangas User-Agent: Icedove 1.5.0.10 (X11/20070329) MIME-Version: 1.0 To: Greg Smith CC: pgsql-patches@postgresql.org Subject: Re: Logging checkpoints and other slowdown causes References: <200704030814.33999.peter_e@gmx.net> <46443F02.6060300@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/112 X-Sequence-Number: 2212 Greg Smith wrote: > On Fri, 11 May 2007, Heikki Linnakangas wrote: >> Or we could add a GUC variable similar to log_connections or >> log_statement to control if the messages are printed or not, and use LOG. > > If the levels for the individual messages are adjusted usefully the > ability to control whether they show up or not falls out of the existing > log level adjustments; I haven't ever felt a strong need for GUC when > using this code. If, as you say, there's already a move in this > direction, then fine--another GUC would be better. The need for GUC becomes apparent when you start adding logging to other modules as well, like we did for autovacuum a while back. If there wasn't a log_autovacuum parameter, you'd have to choose between logging checkpoints and autovacuum actions, or neither. >> We don't need to print the times elapsed in each phase on a separate >> line, that's just derived information from the other lines, unless we >> use different log-levels for detail lines > > Let me turn this around for a second and ask you this: what do you > think people are going to do with this information? I can tell you what > I do. I parse the logs and look for that single line with the summary > information. I then take the three pieces of information it provides > (MB written, time to write, time to fsync) and save them into a table. > From there I generate stats, scatter plots, all sorts of useful stuff. > > If you know when the checkpoint ended, and you know how long each of the > pieces took, you can reconstruct the other times easily. The way you > describe this it is true--that the summary is redundant given the > detail--but if you put yourself in the shoes of a log file parser the > other way around is easier to work with. Piecing together log entries > is a pain, splitting them is easy. > > If I had to only keep one line out of this, it would be the one with the > summary. It would be nice to have it logged at INFO. Yeah, if we have the summary line we don't need the other lines and vice versa. I have sympathy for parsing log files, I've done that a lot in the past and I can see what you mean. Having the individual lines is nice when you're monitoring a running system; you don't get the summary line until the checkpoint is finished. I suppose we can have both the individual lines and the summary, the extra lines shouldn't hurt anyone, and you won't get them unless you turn on the new log_checkpoints parameter anyway. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com