Re: Adjust autovacuum naptime automatically

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: "Matthew T(dot) O'Connor" <matthew(at)zeut(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adjust autovacuum naptime automatically
Date: 2006-08-17 06:00:00
Message-ID: 20060817141323.5F52.ITAGAKI.TAKAHIRO@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


"Matthew T. O'Connor" <matthew(at)zeut(dot)net> wrote:

Sorry, I should have explained more.

> What is this based on? That is, based on what information is it
> deciding to reduce the naptime?

If there are some vacuum or analyze jobs, the naptime is shortened
(i.e, autovacuum is accelerated). And if there are no jobs, the naptime
is lengthened (autovacuum is decelerated).

> Given that we can now specify the vacuum cost delay settings for
> autovacuum and disable tables and everything else, I'm not sure we this
> anymore, at least not as it was originally designed. It sounds like
> Itagaki is doing things a little different with his patch, but I'm not
> sure I understand it.

I noticed my method is based on different views from contrib/pg_autovacuum.
I'm afraid of the lack of vacuum by autovacuum. So if the database seems to
require frequent vacuums, I'll accelerate autovacuum, and vice versa.
If we have a small heavily-updated table and a large rarely-updated table,
we should vacuum the small one soon after vacuum on the large one is done,
even if the large vacuum takes long time. -- but hmm, it may be better to
have multiple autovacuums in such a case primarily.

> My vision of the maintenance window has always been very simple, that
> is, during the maintenance window the thresholds get reduced by some
> factor (probably a GUC variable) so during the day it might take 10000
> updates on a table to cause a vacuum but during the naptime it might be
> 10% of that, 1000. Is this in-line with what others were thinking?

I agree. We can use autovacuum thresholds and cost-delay parameters to
control the frequency and priority of vacuum. I don't think it is good
to control vacuums by changing naptime.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message lst_hoe01 2006-08-17 06:40:17 Re: unsubscribe
Previous Message Peter Eisentraut 2006-08-17 05:36:37 Re: BugTracker (Was: Re: 8.2 features status)

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2006-08-17 07:06:58 Re: [HACKERS] selecting large result sets in psql using cursors
Previous Message Matthew T. O'Connor 2006-08-17 04:47:05 Re: [HACKERS] Adjust autovacuum naptime automatically