Thread: Re: pg_autovacuum does not start on system startup - 8.0 Release -

Re: pg_autovacuum does not start on system startup - 8.0 Release -

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-hackers-win32-owner@postgresql.org
> [mailto:pgsql-hackers-win32-owner@postgresql.org] On Behalf
> Of Harald Massa
> Sent: 24 January 2005 10:12
> To: pgsql-hackers-win32@postgresql.org
> Subject: [pgsql-hackers-win32] pg_autovacuum does not start
> on system startup - 8.0 Release -
>
> It looks as if the pg_autovacuum really waits for the
> postgresql service to
> be startet, BUT that the postgreSQL service is not willing to
> answer that
> quick to connection attempts.
>
> As said... I can start that service manually after Windows
> starts talking to
> me. What can I do to make it run properly?

Hmm, I'll have to think about the best way to do that.

Just for info, most of the service code was written as an exercise for
me personally - it was expected that the pg_autovaccum would be
integrated in the backend which of course ended up not happening, but
consequently the code I had written didn't get anything like as much
testing as it should have done. For which I apologise.

> (acutal workaround will be: .cmd in autostart with "sleep 20
> seconds, net
> start pg_autocacuum")

OK, at least you have a workaround for now.

Regards, Dave.

Re: pg_autovacuum does not start on system startup - 8.0 Release -

From
"Harald Massa"
Date:
Dave,

> > As said... I can start that service manually after Windows
> > starts talking to
> > me. What can I do to make it run properly?
>
> Hmm, I'll have to think about the best way to do that.

My impression is that Service-startup is rather nondeterministic in aspects
of timing.

So I would suggest to integrate that sleepy workaround within pg_autovacuum
service. Just let it sleep for 'some time' ... maybe even configurable ...
before it connects. (recommended default: 180 seconds; NOT microseconds and
NOT milliseconds :))

That will not harm anything: on system-startup there is running a lot of
rubbish anyway, so it does really not hurt if the first vacuum-run is 3
minutes later (on a usual system starting up it will take 3 minutes anyway
before scheduling time-slices for vacuum is really sensible)

And really intensly productive servers should not boot anyway. So: nobody
gets hurt, and pg_usleep is very well tested.

Harald