Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id A90C7632354 for ; Wed, 24 Mar 2010 00:20:38 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58946-07 for ; Wed, 24 Mar 2010 03:20:27 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id A807A63236B for ; Wed, 24 Mar 2010 00:20:26 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id AF3BD348037; Tue, 23 Mar 2010 20:20:25 -0700 (PDT) Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GROn6ybOgvxl; Tue, 23 Mar 2010 20:20:25 -0700 (PDT) Received: from perhan.alvh.no-ip.org (190-95-29-43.bk17-dsl.surnet.cl [190.95.29.43]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id 4592B348036; Tue, 23 Mar 2010 20:20:25 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 246C86E4AA; Wed, 24 Mar 2010 00:20:23 -0300 (CLST) Date: Wed, 24 Mar 2010 00:20:23 -0300 From: Alvaro Herrera To: Scott Marlowe Cc: Bhella Paramjeet-PFCW67 , pgsql-admin@postgresql.org Subject: Re: tuning auto vacuum for highly active tables Message-ID: <20100324032023.GE3240@alvh.no-ip.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/179 X-Sequence-Number: 33978 Scott Marlowe escribió: > On Tue, Mar 23, 2010 at 5:28 PM, Bhella Paramjeet-PFCW67 > wrote: > > Hi Scott, > > > > Thanks for replying. > > Can you explain what you mean by increase the number of threads or how I can increase the number of threads? I just have 2 tables that are very active. I am using postgres version 8.2.7 and 3510 storagetek array with 10 disks in raid 1+0. > > Sure, if you psql into your db and do: > > show autovac > > and hit tab a couple times you'll see a list of all these > configuration options. The one we're looking for is > autovacuum_max_workers. Setting this to something higher will allow > that many threads to run at once. While 6 or 8 threads at 5 or 10 > milliseconds delay is ok on a bigger RAID array, it'll kill the perf > of a machine with a pair of disks in a RAID-1. As you drop the > cost_delay, you can no longer run as many threads without starving > your machine of IO. It's a good idea to keep track of how many vacuum > threads you're usually running and how long they run for > (pg_stat_activity can shed some light there). Hmm, keep in mind that having more workers means that each one of them increments its cost_delay so that the total is roughly what you configured. Also, keep in mind that max_workers is a new setting in 8.3. Since the OP is running 8.2, he can only get one "worker". Presumable he needs to disable autovac for those two very active tables and setup a cron job to process them in their own schedule. -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.