Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty97W-0005MQ-QV for pgsql-performance@arkaria.postgresql.org; Wed, 23 Jan 2013 22:48:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ty97W-00043Y-97 for pgsql-performance@arkaria.postgresql.org; Wed, 23 Jan 2013 22:48:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty97V-00043T-EZ for pgsql-performance@postgresql.org; Wed, 23 Jan 2013 22:48:37 +0000 Received: from qmta11.westchester.pa.mail.comcast.net ([2001:558:fe14:44:76:96:59:211]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ty97S-0005kb-Cx for pgsql-performance@postgresql.org; Wed, 23 Jan 2013 22:48:37 +0000 Received: from omta21.westchester.pa.mail.comcast.net ([76.96.62.72]) by QMTA11.westchester.pa.mail.comcast.net with comcast id rXJt1k0021ZXKqc5BaoXF9; Wed, 23 Jan 2013 22:48:31 +0000 Received: from [192.168.1.176] ([69.142.185.164]) by omta21.westchester.pa.mail.comcast.net with comcast id raoX1k00A3ZEZL53haoXxK; Wed, 23 Jan 2013 22:48:31 +0000 Message-ID: <510068AA.1000001@comcast.net> Date: Wed, 23 Jan 2013 17:48:10 -0500 From: AJ Weber User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Jeff Janes CC: pgsql-performance@postgresql.org Subject: Re: autovacuum fringe case? References: <50E4AAB1.9040902@optionshouse.com> <50EC6549.3090503@optionshouse.com> <50EC6742.4090303@optionshouse.com> <50EC743E.1040209@optionshouse.com> <510015A5.8060601@comcast.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1358981311; bh=CvloOCLDg38Ttp1GMUtl28fnnK9L+GUxV2xj/uRAaZk=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=QJeWPX2rBh0sRePRVErRRzevI7qrKlEERTQ8FuWyCK2EEboM86fEOzoloYP9FAxVL rc4qtADCmB+dvwTSybp3PZUEbozuw13OLj1b5+zTJaIxYK930OpbPbbEtqbYPXq472 spS9Xmji8VfUtf1gXDNnq4zW1VcpjEQaJMq4zzuF/aK9x1XxtUdJgzXviQ7mLAPul5 ArRihMm9orhkO6R58+23LWbcv7uYsX1ci82z0N+5SpIxh+Lfb4VVvNggOSwn4zrRIu 7rP+LDxEL+WyGpY0yAcXl7qTapAJUlu2yVR1XcT0rGOn9ZUWyDZQvFEK11ucKYuwuq 7HRIR2eaAF8iw== X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 1/23/2013 2:13 PM, Jeff Janes wrote: > On Wed, Jan 23, 2013 at 8:53 AM, AJ Weber wrote: >> I have a server that is IO-bound right now (it's 4 cores, and top indicates >> the use rarely hits 25%, but the Wait spikes above 25-40% regularly). > How long do the spikes last? From what I can gather, a few seconds to a few minutes. > >> The >> server is running postgresql 9.0 and tomcat 6. As I have mentioned in a >> previous thread, I can't alter the hardware to add disks unfortunately, so >> I'm going to try and move postgresql off this application server to its own >> host, but this is a production environment, so in the meantime... >> >> Is it possible that some spikes in IO could be attributable to the >> autovacuum process? Is there a way to check this theory? > set log_autovacuum_min_duration to 0 or some positive number, and see > if the vacuums correlate with periods of io stress (from sar or > vmstat, for example--the problem is that sar only takes snapshots > every 10 minutes, which is too coarse if the spikes are short). I used iotop last time it was going crazy, and there were 5 postgres procs at the top of the list (and virtually nothing else) all doing a SELECT. So I'm also going to restart the DB this weekend with log-min-duration enabled. Could also be some misbehaving queries... Is there a skinny set of instructions on loading pg_stat_statements? Or should I just log them and review them from there? > >> Would it be advisable (or even permissible to try/test) to disable >> autovacuum, and schedule a manual vacuumdb in the middle of the night, when >> this server is mostly-idle? > Scheduling a manual vacuum should be fine (but keep in mind that > vacuum has very different default cost_delay settings than autovacuum > does. If the server is completely idle that shouldn't matter, but if > it is only mostly idle, you might want to throttle the IO a bit). But > I certainly would not disable autovacuum without further evidence. If > a table only needs to be vacuumed once a day and you preemptively do > it at 3a.m., then autovac won't bother to do it itself during the day. > So there is no point, but much risk, in also turning autovac off. If I set autovacuum_max_workers = 1, will that effectively single-thread it so I don't have two running at once? Maybe that'll mitigate disk contention a little at least? > > Cheers, > > Jeff -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance