Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 757502E0033 for ; Fri, 4 Jan 2008 06:17:01 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 25161-09 for ; Fri, 4 Jan 2008 06:16:36 -0400 (AST) Received: from outmail128077.authsmtp.net (outmail128077.authsmtp.net [62.13.128.77]) by postgresql.org (Postfix) with ESMTP id 6DBA62E0335 for ; Fri, 4 Jan 2008 06:16:51 -0400 (AST) Received: from outmail128184.authsmtp.net (outmail128184.authsmtp.net [62.13.128.184]) by punt4.authsmtp.com (8.14.1/8.14.1/Kp) with ESMTP id m04AGlIe034530; Fri, 4 Jan 2008 10:16:47 GMT Received: from [192.168.0.3] (81-6-228-215.dyn.gotadsl.co.uk [81.6.228.215]) (authenticated bits=0) by mail.authsmtp.com (8.13.8/8.13.8/Kp) with ESMTP id m04AGkNr027112; Fri, 4 Jan 2008 10:16:46 GMT Subject: Re: Commit takes a long time. From: Simon Riggs To: Tom Lane Cc: Peter Childs , Postgresql Performance In-Reply-To: <6663.1199378101@sss.pgh.pa.us> References: <6663.1199378101@sss.pgh.pa.us> Content-Type: text/plain Date: Fri, 04 Jan 2008 10:17:17 +0000 Message-Id: <1199441837.18598.18.camel@ebony.site> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2 Content-Transfer-Encoding: 7bit X-Server-Quench: 27db63b2-baae-11dc-814e-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaAFbZ1hf HGQLW1xEUV17WGV/ bw0fZQRDZFRMXQ10 UklMXVBXCwUmXBwF d2lFLFtydQJHeXw+ ZEVlVj5ZWxAoc0Uv QFMGRDxTeGZhPDMC WEFcIh5UcAJLdhoR aVd4ByJDAzANdhEA MjUdGAoUCH10LyFQ Qx1FMVsRTF1DF3Y4 QBYNVSkuGEBDL2Qg X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:787/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system! X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/13 X-Sequence-Number: 28252 On Thu, 2008-01-03 at 11:35 -0500, Tom Lane wrote: > "Peter Childs" writes: > > Using Postgresql 8.1.10 every so often I get a transaction that takes a > > while to commit. > > > I log everything that takes over 500ms and quite reguallly it says things > > like > > > 707.036 ms statement: COMMIT > > AFAIK there are only two likely explanations for that: > > 1. You have a lot of deferred triggers that have to run at COMMIT time. > > 2. The disk system gets so bottlenecked that fsync'ing the commit record > takes a long time. I've seen 3 other reasons for this in the field while tuning people's systems. In 8.3 we've fixed one, reduced the other and the third is amenable to tuning via wal_buffers even in 8.1 -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com