pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Clarification Needed: When does autovacuum daemon run?
7+ messages / 3 participants
[nested] [flat]

* Clarification Needed: When does autovacuum daemon run?
@ 2010-05-18 09:56  Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  0 siblings, 2 replies; 7+ messages in thread

From: Narasimha Murthy-VRFX87 @ 2010-05-18 09:56 UTC (permalink / raw)
  To: pgsql-admin

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-US.
pdf
<http://www.postgresql.org/files/documentation/pdf/8.2/postgresql-8.2-US
.pdf> 
 
Regards, Narasimha Murthy
Cell +91 95814 98895, +91-94940 62794 | 040-2347 2025 (O) | x2025 (O)
 

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-18 10:10  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Devrim GÜNDÜZ @ 2010-05-18 10:10 UTC (permalink / raw)
  To: Narasimha Murthy-VRFX87 <VRFX87@motorola.com>; +Cc: pgsql-admin

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

Attachments:

  signature.asc (application/pgp-signature, 197B) download

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-18 11:04  Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Narasimha Murthy-VRFX87 @ 2010-05-18 11:04 UTC (permalink / raw)
  To: Ian Lea <ian.lea@gmail.com>; Devrim GÜNDÜZ <devrim@gunduz.org>; +Cc: pgsql-admin

 
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 minute the 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 healthy on a little but often basis.  It is not designed to run once a day at a specific time.  If that is really what you want, 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)
>



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-18 14:51  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Alvaro Herrera @ 2010-05-18 14:51 UTC (permalink / raw)
  To: Narasimha Murthy-VRFX87 <vrfx87@motorola.com>; +Cc: pgsql-admin

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.
-- 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-19 20:51  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Alvaro Herrera @ 2010-05-19 20:51 UTC (permalink / raw)
  To: Narasimha Murthy-VRFX87 <vrfx87@motorola.com>; +Cc: Ian Lea <ian.lea@gmail.com>; Devrim GÜNDÜZ <devrim@gunduz.org>; pgsql-admin

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.
-- 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-20 06:47  Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 7+ messages in thread

From: Narasimha Murthy-VRFX87 @ 2010-05-20 06:47 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: Ian Lea <ian.lea@gmail.com>; Devrim GÜNDÜZ <devrim@gunduz.org>; pgsql-admin

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. My query in other word was, if I set autovacuum_naptime to 1 hr, which minute of an hour the auto-vacuum runs (oth min, 15th min or something else).



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: Clarification Needed: When does autovacuum daemon run?
@ 2010-05-20 17:20  Alvaro Herrera <alvherre@alvh.no-ip.org>
  parent: Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Alvaro Herrera @ 2010-05-20 17:20 UTC (permalink / raw)
  To: Narasimha Murthy-VRFX87 <vrfx87@motorola.com>; +Cc: Ian Lea <ian.lea@gmail.com>; Devrim GÜNDÜZ <devrim@gunduz.org>; pgsql-admin

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. My query in other word was, if I set autovacuum_naptime to 1 hr, which minute of an hour the auto-vacuum runs (oth min, 15th min 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 run frequently in the background, not designed to run once a day at a specific time. Due to this design intent, autovacuum_naptime is set to 1 min by default and autovacuum runs lazy/plain/standard vacuum commands (so that Vacuum can run concurrently with other normal DB operations).

Correct.
-- 



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2010-05-20 17:20 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 09:56 Clarification Needed: When does autovacuum daemon run? Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
2010-05-18 10:10 ` Devrim GÜNDÜZ <devrim@gunduz.org>
2010-05-18 14:51 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2010-05-18 11:04 Re: Clarification Needed: When does autovacuum daemon run? Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
2010-05-19 20:51 ` Alvaro Herrera <alvherre@alvh.no-ip.org>
2010-05-20 06:47   ` Narasimha Murthy-VRFX87 <VRFX87@motorola.com>
2010-05-20 17:20     ` Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox