Re: postmaster graceful shutdown time !!!

Lists: pgsql-bugs
From: "Sivaraman K(dot)G" <ksivaram(at)ssd(dot)usa(dot)alcatel(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: postmaster graceful shutdown time !!!
Date: 2005-08-01 05:24:53
Message-ID: 42EDB225.DAF9C848@ssd.usa.alcatel.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi,
<p>Has any one have the statistics that how long the postmaster takes for
graceful shutdown
<br>(when SIGTERM&nbsp;is send) ?
<p>Thanks
<br>Siva
<pre>--&nbsp;
K.G.Sivaraman, Axes Technologies (I) Pvt Ltd

"The only SERVICE to be done for our lower classes is to give them&nbsp;
EDUCATION, to develop their lost individuality" - Swami Vivekananda</pre>
&nbsp;</html>

Attachment Content-Type Size
unknown_filename text/html 442 bytes

From: John R Pierce <pierce(at)hogranch(dot)com>
To: "Sivaraman K(dot)G" <ksivaram(at)ssd(dot)usa(dot)alcatel(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: postmaster graceful shutdown time !!!
Date: 2005-08-01 06:25:25
Message-ID: 42EDC055.8000204@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Sivaraman K.G wrote:
> Hi,
>
> Has any one have the statistics that how long the postmaster takes for
> graceful shutdown
> (when SIGTERM is send) ?

that would be EXTREMELY dependent on a large number of variables.

an idle instance with no pending writes on a reasonably fast modern 'nix system
should exit nearly instantly. If there's 50 open connections with
transactions-in-progress, and a lot of write buffers to flush, its gonna take
longer.

ok, here's a linux box with RHEL 3.5 X86_64, postgres 7.4.7 built for 32bit...

# time service postgresql stop
Stopping postgresql service: [ OK ]

real 0m2.100s
user 0m0.000s
sys 0m0.020s

so, 2 seconds on a opteron 2.4Ghz for pgsql 7.4.7

now, the 'service postgresql' command runs /etc/rc.d/init.d, which in turn is
using pg_ctl to stop rather than SIGTERM, but the net effect is the same.

here's a RHEL3.5 x86 (32bit) postgres 8.0.1 system..,

# time service postgresql stop
Stopping PostgreSQL: postmaster stopped
ok

real 0m1.086s
user 0m0.030s
sys 0m0.040s

1 second for a xeon 2.8Ghz w/ pgsql 8.0.1