Thread: Startup scripts - Use -m fast or smart?

Startup scripts - Use -m fast or smart?

From
Glyn Astill
Date:
Hi chaps,

I've just changed my startup scripts to use the linux one supplied in
contrib.

I noticed this uses the "-m fast" argument for start and stop.

Before I setup the scripts I was using "-m smart" to make sure all
queries were finished before shutting dowm on all but my WAL slave.

I was going to change these to -m smart just to be safe, however I
just wanted to check if there was any reason not to do this?

Thanks
Glyn


      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com



Re: Startup scripts - Use -m fast or smart?

From
"Albe Laurenz"
Date:
Glyn Astill wrote:
> I've just changed my startup scripts to use the linux one supplied in
> contrib.
>
> I noticed this uses the "-m fast" argument for start and stop.
>
> Before I setup the scripts I was using "-m smart" to make sure all
> queries were finished before shutting dowm on all but my WAL slave.
>
> I was going to change these to -m smart just to be safe, however I
> just wanted to check if there was any reason not to do this?

If you have "pg_ctl stop -m smart" in your shutdown script, this
will prevent your host from shutting down as long as somebody is still
connected to the database, even if the connections are idle.

This is most likely *not* what you want.

-m fast is the correct thing for server shutdown. It will do no damage
as all active transactions will be rolled back.

If there are database transactions that you do not want to interrupt,
the best approach is not to shutdown the database server.

Yours,
Laurenz Albe

Re: Startup scripts - Use -m fast or smart?

From
Glyn Astill
Date:
Thanks Laurenz, that's a good point, I shall leave them as is.

Glyn


--- Albe Laurenz <laurenz.albe@wien.gv.at> wrote:

> Glyn Astill wrote:
> > I've just changed my startup scripts to use the linux one
> supplied in
> > contrib.
> >
> > I noticed this uses the "-m fast" argument for start and stop.
> >
> > Before I setup the scripts I was using "-m smart" to make sure
> all
> > queries were finished before shutting dowm on all but my WAL
> slave.
> >
> > I was going to change these to -m smart just to be safe, however
> I
> > just wanted to check if there was any reason not to do this?
>
> If you have "pg_ctl stop -m smart" in your shutdown script, this
> will prevent your host from shutting down as long as somebody is
> still
> connected to the database, even if the connections are idle.
>
> This is most likely *not* what you want.
>
> -m fast is the correct thing for server shutdown. It will do no
> damage
> as all active transactions will be rolled back.
>
> If there are database transactions that you do not want to
> interrupt,
> the best approach is not to shutdown the database server.
>
> Yours,
> Laurenz Albe
>



      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com