Обсуждение: Clarification Needed: When does autovacuum daemon run?

Поиск
Список
Период
Сортировка

Clarification Needed: When does autovacuum daemon run?

От
"Narasimha Murthy-VRFX87"
Дата:
Hello,
 
Postgresql-8.2 manual has mentioned following points.
* The autovacuum daemon, when enabled, runs every autovacuum_naptime seconds.
* autovacuum_naptime (integer): Specifies the delay between "activity rounds" for the autovacuum daemon....The delay is measured in seconds, and the default is one minute (1m)....
 
My Query: I want to run autovacuum daemon everyday at 5 am. By setting autovacuum_naptime to 24*60*60 (# of seconds in a day), I can run the daemon everyday. But, how do I ensure the daemon runs at 5am? What is the "activity rounds" mentioned in the manual? Pl clarify. Appreciate an early reply.
 
 
Regards, Narasimha Murthy
Cell +91 95814 98895, +91-94940 62794 | 040-2347 2025 (O) | x2025 (O)
 

Re: Clarification Needed: When does autovacuum daemon run?

От
Devrim GÜNDÜZ
Дата:
On Tue, 2010-05-18 at 17:56 +0800, Narasimha Murthy-VRFX87 wrote:
> My Query: I want to run autovacuum daemon everyday at 5 am.

That is not "auto"vacuum. What you want is manual vacuum.
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org  Twitter: http://twitter.com/devrimgunduz

Вложения

Re: Clarification Needed: When does autovacuum daemon run?

От
"Narasimha Murthy-VRFX87"
Дата:
Thanks Devrim and Ian, for a quick response.

I need some more clarification. autovacuum_naptime takes one minute by default. In this case, which second of each
minutethe autovacuum daemon runs (provided it is enabled)? What is the "activity rounds" mentioned in the manual? 

Regards, Narasimha Murthy
Cell +91 95814 98895, +91-94940 62794 | 040-2347 2025 (O) | x2025 (O)

-----Original Message-----
From: Ian Lea [mailto:ian.lea@gmail.com]
Sent: Tuesday, May 18, 2010 3:43 PM
To: Narasimha Murthy-VRFX87
Subject: Re: [ADMIN] Clarification Needed: When does autovacuum daemon run?

As far as I understand it, the idea of autovacuum is that it chugs away transparently in the background, keeping things
healthyon a little but often basis.  It is not designed to run once a day at a specific time.  If that is really what
youwant, I suggest you disable autovacuum and run vacuum manually at 05:00. 


--
Ian.


On Tue, May 18, 2010 at 10:56 AM, Narasimha Murthy-VRFX87 <VRFX87@motorola.com> wrote:
> Hello,
>
> Postgresql-8.2 manual has mentioned following points.
> * The autovacuum daemon, when enabled, runs every autovacuum_naptime
> seconds.
> * autovacuum_naptime (integer): Specifies the delay between "activity
> rounds" for the autovacuum daemon....The delay is measured in seconds,
> and the default is one minute (1m)....
>
> My Query: I want to run autovacuum daemon everyday at 5 am. By setting
> autovacuum_naptime to 24*60*60 (# of seconds in a day), I can run the
> daemon everyday. But, how do I ensure the daemon runs at 5am? What is
> the "activity rounds" mentioned in the manual? Pl clarify. Appreciate an early reply.
>
> [postgresql-8.2-US.pdf]
> http://www.postgresql.org/files/documentation/pdf/8.2/postgresql-8.2-U
> S.pdf
>
> Regards, Narasimha Murthy
> Cell +91 95814 98895, +91-94940 62794 | 040-2347 2025 (O) | x2025 (O)
>

Re: Clarification Needed: When does autovacuum daemon run?

От
Alvaro Herrera
Дата:
Excerpts from Narasimha Murthy-VRFX87's message of mar may 18 05:56:26 -0400 2010:
> Hello,
>
> Postgresql-8.2 manual has mentioned following points.
> * The autovacuum daemon, when enabled, runs every autovacuum_naptime
> seconds.
> * autovacuum_naptime (integer): Specifies the delay between "activity
> rounds" for the autovacuum daemon....The delay is measured in seconds,
> and the default is one minute (1m)....
>
> My Query: I want to run autovacuum daemon everyday at 5 am.

You cannot do that with autovacuum currently.  Use cron.
--

Re: Clarification Needed: When does autovacuum daemon run?

От
Alvaro Herrera
Дата:
Excerpts from Narasimha Murthy-VRFX87's message of mar may 18 07:04:34 -0400 2010:

> I need some more clarification. autovacuum_naptime takes one minute by
> default. In this case, which second of each minute the autovacuum
> daemon runs (provided it is enabled)?

Why does it matter which second it runs?

> What is the "activity rounds" mentioned in the manual??

Each worker start is a new round.
--

Re: Clarification Needed: When does autovacuum daemon run?

От
"Narasimha Murthy-VRFX87"
Дата:
Hi Alvaro Herrera,

Since, my original plan was to run the auto-vacuum daily EXACTLY at 5 am, I wanted to know which seconds of a minute.
Myquery in other word was, if I set autovacuum_naptime to 1 hr, which minute of an hour the auto-vacuum runs (oth min,
15thmin or something else). 

From the clarification given by the you and other community members, I now understood that autovacuum is designed to
runfrequently in the background, not designed to run once a day at a specific time. Due to this design intent,
autovacuum_naptimeis set to 1 min by default and autovacuum runs lazy/plain/standard vacuum commands (so that Vacuum
canrun concurrently with other normal DB operations). 

Regards, Narasimha Murthy
Cell +91 95814 98895, +91-94940 62794 | 040-2347 2025 (O) | x2025 (O)

-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Alvaro Herrera
Sent: Thursday, May 20, 2010 2:21 AM
To: Narasimha Murthy-VRFX87
Cc: Ian Lea; Devrim GÜNDÜZ; pgsql-admin
Subject: Re: [ADMIN] Clarification Needed: When does autovacuum daemon run?

Excerpts from Narasimha Murthy-VRFX87's message of mar may 18 07:04:34 -0400 2010:

> I need some more clarification. autovacuum_naptime takes one minute by
> default. In this case, which second of each minute the autovacuum
> daemon runs (provided it is enabled)?

Why does it matter which second it runs?

> What is the "activity rounds" mentioned in the manual??

Each worker start is a new round.
--

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: Clarification Needed: When does autovacuum daemon run?

От
Alvaro Herrera
Дата:
Excerpts from Narasimha Murthy-VRFX87's message of jue may 20 02:47:21 -0400 2010:
> Hi Alvaro Herrera,
>
> Since, my original plan was to run the auto-vacuum daily EXACTLY at 5 am, I wanted to know which seconds of a minute.
Myquery in other word was, if I set autovacuum_naptime to 1 hr, which minute of an hour the auto-vacuum runs (oth min,
15thmin or something else). 

Yeah, you have no way to be know.  I guess you could turn autovacuum off
in postgresql.conf all day, and exactly at 5am you have a cron job that
edits postgresql.conf and reloads Postgres.  This would start up
autovacuum, which would then continue with the regular schedule.
This is hardly ideal; there were plans to improve on this by having an
autovacuum schedule, but I think the demand for this feature has
decreased considerable, so I haven't given it any minute's thought.

> From the clarification given by the you and other community members, I now understood that autovacuum is designed to
runfrequently in the background, not designed to run once a day at a specific time. Due to this design intent,
autovacuum_naptimeis set to 1 min by default and autovacuum runs lazy/plain/standard vacuum commands (so that Vacuum
canrun concurrently with other normal DB operations). 

Correct.
--