Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4A5B0B5DF8B for ; Fri, 4 Nov 2011 15:26:50 -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 40511-01-4 for ; Fri, 4 Nov 2011 18:26:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp.peak6.com (smtp.peak6.com [38.98.137.6]) by mail.postgresql.org (Postfix) with ESMTP id 9166FB5DFAD for ; Fri, 4 Nov 2011 15:26:42 -0300 (ADT) X-AuditID: 0a64cb1e-b7c21ae0000074d4-03-4eb42e5b5496 Message-ID: <4EB42E5F.5080502@peak6.com> Date: Fri, 4 Nov 2011 13:26:39 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Claudio Freire CC: Kevin Grittner , postgres performance list , Tom Lane Subject: Re: Blocking excessively in FOR UPDATE References: <6734.1320345936@sss.pgh.pa.us> <19908.1320363946@sss.pgh.pa.us> <4EB3CC010200002500042A53@gw.wicourts.gov> <4EB3D5950200002500042A60@gw.wicourts.gov> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.220.61] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJIsWRmVeSWpSXmKPExsXCxcQrphutt8XPYOkCAYtH55ezWDz51cRq cX3mOWaLU6vuMjmweOycdZfd48K+aewei55tZPF4NWEzSwBLVAOjTWJeXn5JYkmqQkpqcbKt UoCro7eZQnBJYl5KYlGKgktmcXJOYmZuapGSQmaKrZKRkkJBTmJyam5qXomtUmJBQWpeipId lwIGsAEqy8xTSM1Lzk/JzEu3VfIM9te1sDC11DVUsotHgIRuloydbRfYCroFKk5v28zawPiV p4uRk0NCwETi/JVeJghbTOLCvfVsIDavgIZE66SdjCA2i4CKxNxte9lBbDYBNYmFu2+CxYUE ZCX2rzrHCmLzCwhL7PvQxAxiiwqESDyb8BxqjqDEyZlPWEBsEQFtiTN3NwHN4eJgFuhjlHj2 +CjYYmEBS4kpj9YwgiSEBA6wSJxdvQ6oioODUyBQYseEVJAaZgFbiQtzrrNA2PIS29/OYYY4 Qk7iTgPIMg6gBxQkri/3n8AoNAvJ6llIumch6V7AyLyKUby4LDE5I9O0oDi3pMBQryA1MdtM Ly+1ZBMjKMJTTsvtYJy+VPEQowAHoxIPr4DUFj8h1sSy4srcQ4wSHMxKIrxxjEAh3pTEyqrU ovz4otKc1OJDjNrAMJvILMWdnA9MPnkl8cYGBkrivFOnrvMTEkgHJoLs1NSC1CKYaiYOTqkG Rr0V4az/1Ww+NlmKiEfscFs+lS/6xs1TNmdU/M72tMlem8FnzaumHTjHaldsqmA3U7Tu7KyG QM1NKnmehfmf9nKclj8S9ou/s81wccapRM4F/zutGrZP+5q1ZF3FIaaGoIx23ts93dufVW9a GSWb8kVyzrwJLddcDzanNL3weO10J616h3yDEktxRqKhFnNRcSIA4HhLp/wCAAA= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.101 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/85 X-Sequence-Number: 45596 On 11/04/2011 12:22 PM, Claudio Freire wrote: > bgwriter_delay = 1000ms > wal_writer_delay=2000ms > commit_delay=10000 !? Maybe someone can back me up on this, but my interpretation of these settings suggests they're *way* too high. That commit_delay especially makes me want to cry. From the manual: "Setting commit_delay can only help when there are many concurrently committing transactions, and it is difficult to tune it to a value that actually helps rather than hurt throughput." Meaning it may halt all of your commits up to *ten seconds* if it doesn't think there was enough activity to warrant a write. Ouch. Your bgwriter_delay and wal_writer_delay settings are equally odd. You've made the background writer so passive that when it does finally run, it's going to have a ton of work to do, causing giant write spikes. I'm not sure whether or not this also causes compounding problems with locks and backend write delays. > checkpoint complete: wrote 589 buffers (3.6%); 0 transaction log > file(s) added, 0 removed, 8 recycled; write=590.325 s, sync=0.055 s, > total=590.417 s > > 590s seems an awful lot for 589 buffers. You're misinterpreting this. The checkpoint completion target is multiplied against your checkpoint timeout. 590 seconds is roughly ten minutes, and for 589 buffers, it wrote one per second. That's about as slow as it can possibly write that many buffers. It had *up to* 24 minutes, and if it had more buffers available to write, it would have written them. The number you really care about is "sync=0.055 s" which is how much time the controller spent syncing that data to disk. If you're having real problems writing or lock delays due to IO stalls, you'll see that sync parameter shoot way up. This can also be elevated in certain NVRAM-based solutions. Once you start seeing whole seconds, or minutes, it might actually matter. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 800 | Chicago IL, 60604 312-676-8870 sthomas@peak6.com ______________________________________________ See http://www.peak6.com/email-disclaimer/ for terms and conditions related to this email