Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 74F3E1335B36 for ; Fri, 19 Nov 2010 22:28:20 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 12184-07 for ; Sat, 20 Nov 2010 02:28:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id C585E133655C for ; Fri, 19 Nov 2010 22:28:12 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id oAK2SBo0028303; Fri, 19 Nov 2010 21:28:11 -0500 (EST) To: "Simon Poole" cc: pgsql-bugs@postgresql.org, Alvaro Herrera Subject: Re: BUG #5759: Autovacuum cost limit trends to 1, using default config In-reply-to: <201011191532.oAJFWxR2095324@wwwmaster.postgresql.org> References: <201011191532.oAJFWxR2095324@wwwmaster.postgresql.org> Comments: In-reply-to "Simon Poole" message dated "Fri, 19 Nov 2010 15:32:59 +0000" Date: Fri, 19 Nov 2010 21:28:11 -0500 Message-ID: <28302.1290220091@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/139 X-Sequence-Number: 28719 "Simon Poole" writes: > With the default autovacuum settings (3 workers, and default cost_limit of > 200), all three workers start with a cost-limit of 66 each, but after each > table is completed, the cost-limit is reduced until they're all running with > a cost-limit of 1. Yeah, I was able to reproduce this, more or less. It looks like the problem is that the cost rebalancing algorithm uses VacuumCostLimit as an input, and supposes that's constant ... but after the first table it's actually been reduced by a previous iteration (assuming there's more than one worker). So you can end up computing a smaller value on the next round. Lather, rinse, repeat. Will fix. Thanks for the report! regards, tom lane