Re: Automatic shutdown from Linux. - Mailing list pgsql-admin

From Tom Lane
Subject Re: Automatic shutdown from Linux.
Date
Msg-id 109.1052485477@sss.pgh.pa.us
Whole thread Raw
In response to Re: Automatic shutdown from Linux.  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-admin
Bruno Wolff III <bruno@wolff.to> writes:
> Probably the init scripts for your system already do this for you.
> If you system displays a message for each service being shutdown
> during a shutdown you should be able to watch and see if postgres
> is shutdown as part of that process.

Also, in a conventionally-run Unix system the database will shut down
cleanly even without any init-script help.  This is because the
postmaster and backends are designed (with malice aforethought ;-))
to interpret SIGTERM as a fast-shutdown request.  Assuming that the
kernel gives user processes a reasonable number of seconds between
SIGTERM and SIGKILL --- enough for a checkpoint --- you don't really
need anything else.

One reason not to crank shared_buffers up to the moon is that with a
huge number of dirty buffers, checkpoint might take too long for this
scenario to be robust.  On my HPUX box, the kernel will give twenty
seconds' grace between SIGTERM and SIGKILL, which is enough for even
a pretty messy checkpoint, but I dunno what the equivalent delay is
on other platforms.

            regards, tom lane


pgsql-admin by date:

Previous
From: "dlangschied"
Date:
Subject: Re: Automatic shutdown from Linux.
Next
From: Randall Perry
Date:
Subject: Re: Pg_hba and dynamic dns