Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 0B4F11EB83EA for ; Thu, 23 Feb 2012 11:18:39 -0400 (AST) Received: from li339-205.members.linode.com ([96.126.114.205] helo=squeakycode.net) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S0aRK-0007Kt-Rx for pgsql-performance@postgresql.org; Thu, 23 Feb 2012 15:18:39 +0000 Received: from [192.168.10.84] (97-64-237-59.client.mchsi.com [97.64.237.59]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id 94EF517B29; Thu, 23 Feb 2012 10:18:24 -0500 (EST) Message-ID: <4F4658CB.3030505@squeakycode.net> Date: Thu, 23 Feb 2012 09:18:35 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Thom Brown CC: Alessandro Gagliardi , pgsql-performance@postgresql.org Subject: Re: set autovacuum=off References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/161 X-Sequence-Number: 46333 On 2/23/2012 6:34 AM, Thom Brown wrote: > On 22 February 2012 23:50, Alessandro Gagliardi wrote: >> I have a database where I virtually never delete and almost never do >> updates. (The updates might change in the future but for now it's okay to >> assume they never happen.) As such, it seems like it might be worth it to >> set autovacuum=off or at least make it so vacuuming hardly ever occurs. >> Actually, the latter is probably the more robust solution, though I don't >> know how to do that (hence me writing this list). I did try turning >> autovacuum off but got: >> >> ERROR: parameter "autovacuum" cannot be changed now >> SQL state: 55P02 >> >> Not sure what, if anything, I can do about that. > > Autovacuum is controlled by how much of a table has changed, so if a > table never changes, it never gets vacuumed (with the exceptional case > being a forced vacuum freeze to mitigate the transaction id > wrap-around issue). The settings which control this are > autovacuum_vacuum_threshold and autovacuum_vacuum_scale_factor. > Therefore it isn't necessary to disable autovacuum. > > But if you are adamant about disabling it, you need to change it in > your postgresql.conf file and restart the server. > Agreed, don't disable autovacuum. It's not that demanding, and if you do need it and forget to run it, it might cause you more problems. I have a db that's on a VM that doesnt get hit very much. I've noticed IO is a little busy (we are talking small percents of percents less than one) but still more that I thought should be happening on a db with next to no usage. I found setting autovacuum_naptime = 6min made the IO all but vanish. And if I ever get a wild hair and blow some stuff away, the db will clean up after me. -Andy