pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas F.O'Connell <tfo@sitening.com>
To: Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>
Cc: PGSQL Admin <pgsql-admin@postgresql.org>
Subject: Re: Pg_autovacuum script.
Date: Mon, 11 Apr 2005 17:43:52 -0500
Message-ID: <595622f28653c8e3910b8b1328166439@sitening.com> (raw)
In-Reply-To: <D1444817B78AB546BF2896C2B70E7F04371FED@ganesh.au.lpint.net>
References: <D1444817B78AB546BF2896C2B70E7F04371FED@ganesh.au.lpint.net>

A while back, I wrote this:

http://www.sitening.com/auto_pg_autovacuum

While not exactly an init script, it sanely avoids multiply starting 
pg_autovacuum.

Then I did this:

http://www.sitening.com/pgautovacuum

which is a proper init script.

Thanks for prompting me to post it! Now there are some options!

But I'm hopeful that autovacuum will be integrated into 8.1, thereby 
laying this issue to rest.

-tfo

--
Thomas F. O'Connell
Co-Founder, Information Architect
Sitening, LLC

Strategic Open Source: Open Your i™

http://www.sitening.com/
110 30th Avenue North, Suite 6
Nashville, TN 37203-6320
615-260-0005

On Apr 10, 2005, at 10:19 PM, Theo Galanakis wrote:

> Since I could not locate anything similar on the net, I have written a 
> script to automatically start and stop the autovacuum daemon. This 
> should be added to the existing postgresql script.
>
>  Please let me know if you can see any shortcomings. I have taken into 
> consideration that more than one postmaster may be running on the same 
> machine, so I have stored the pg_autovacuum pid into a file, which is 
> referenced when bringing down the postmaster instance. I have not gone 
> to the effort of including all the pg_autovacuum parameters, you can 
> add them at will.
>
>  One issue I can foresee is maintainability, where you will have to 
> update the postgresql script file with the snippets below, every 
> postgres upgrade.
>
> Here are the snippets :
>
>  This goes where all the other init scripts are located.
> # Initialize pg_autovacuum defaults. Theo Galanakis 11/04/2005
> PGAUTO_LOGFILE=/var/lib/pg_autovacuum.log
> PGAUTO_SLEEP=60
>
> Added to the end of the Start function.
>  # Start pg_autovacuum. Theo Galanakis 11/05/2005
>         PAUTO_START=$"Starting pg_autovacuum service: "
>         echo -n "$PAUTO_START"
>         pg_autovacuum -D -s ${PGAUTO_SLEEP} -p ${PGPORT} -U postgres 
> -L ${PGAUTO_LOGFILE}
>         pg_autovacuum_pid=`pidof -s $PGENGINE/pg_autovacuum`
>         if [ $pg_autovacuum_pid ]
>         then
>            success "$PAUTO_START"
>            echo $pg_autovacuum_pid > 
> /var/run/pg_autovacuum.${PGPORT}.pid
>            echo
>         else
>            failure "$PAUTO_START"
>            echo
>         fi
>
> Added to the end of the Stop function.
> # Stop pg_autovaccum. Theo Galanakis 11/04/2005
>         echo -n $"Stopping pg_autovacuum service: "
>         pg_autovacuum_pid=`head -n 1 
> /var/run/pg_autovacuum.${PGPORT}.pid`
>         kill -TERM $pg_autovacuum_pid
>         ret=`ps --no-heading ${pg_autovacuum_pid}`
>         if [ -z "$ret" ]
>         then
>                 echo_success
>         else
>                 echo_failure
>         fi
>         echo
>         rm -f /var/run/pg_autovacuum.${PGPORT}.pid
>
> ______________________________________________________________________
>  This email, including attachments, is intended only for the addressee
>  and may be confidential, privileged and subject to copyright. If you
>  have received this email in error, please advise the sender and delete
>  it. If you are not the intended recipient of this email, you must not
>  use, copy or disclose its content to anyone. You must not copy or
>  communicate to others content that is confidential or subject to
>  copyright, unless you have the consent of the content owner.
>




view thread (2+ messages)

Message-ID: <595622f28653c8e3910b8b1328166439@sitening.com>
Permalink:  ../595622f28653c8e3910b8b1328166439@sitening.com/
Also on:    postgresql.org/message-id/595622f28653c8e3910b8b1328166439@sitening.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: tfo@sitening.com, Theo.Galanakis@lonelyplanet.com.au
  Subject: Re: Pg_autovacuum script.
  In-Reply-To: <595622f28653c8e3910b8b1328166439@sitening.com>
  References: <D1444817B78AB546BF2896C2B70E7F04371FED@ganesh.au.lpint.net> <595622f28653c8e3910b8b1328166439@sitening.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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