From: Greg Smith <greg@2ndquadrant.com>
To: felix <crucialfelix@gmail.com>
Cc: Scott Marlowe <scott.marlowe@gmail.com>
Cc: sthomas@peak6.com, "pgsql-performance@postgresql.org" <pgsql-performance@postgresql.org>
Subject: Re: Really really slow select count(*)
Date: Mon, 07 Feb 2011 02:51:50 -0500
Message-ID: <4D4FA496.8060206@2ndquadrant.com> (raw)
In-Reply-To: <AANLkTimnFc-hKG+PFEfwBPLAoK6q9kx=nc_4Fr++C_QB@mail.gmail.com>
References: <AANLkTinAJcm5A+i1O_R87aiYyu8N2OWgoaL9RfR=tUR9@mail.gmail.com>
<4D4C138C.7010304@2ndquadrant.com>
<4D4C1555.40209@peak6.com>
<AANLkTikrS5JkJDMjAXpcRWRnuLbX+MHB=CWb_mFa9qb-@mail.gmail.com>
<4D4C2AC3.5020804@peak6.com>
<AANLkTin8ndBSU9ZJ2uAdnvYQ7oLBg2S04bqAXn-s5qv+@mail.gmail.com>
<AANLkTim+aLaihKbNSsiiL4exgtCeRqCh_50j48jHFDQm@mail.gmail.com>
<AANLkTimnFc-hKG+PFEfwBPLAoK6q9kx=nc_4Fr++C_QB@mail.gmail.com>
felix wrote:
> So is it normal for postgres to report that it failed to shut down,
> operate for an hour and then go ahead and restart itself ?
You've already gotten a few explanations for why waiting for connections
can cause this. I'll only add that it is critical to be watching the
database log file when doing work like this with PostgreSQL. Go back
and check it if you still have the data from when your problematic
restart attempt happened, normally you'll get some warnings about it
starting to shutdown. Try to look for the actual server shutdown
message and then the restart one after doing this sort of thing. If you
don't see them when you do this again, you'll know something unexpected
is happening, and then to look into what that is.
Also, as a general downtime commentary born from years of being the
receiving end of outages, I'd recommend against ever doing any server
maintenance operation for the first time just before bedtime. While
that may be convienent from a "less users are using the site"
perspective, the downside is what you've seen here: mistakes can mean
rather extended outages. Better to get up early and do this sort of
thing instead, so you can watch the site afterwards for a few hours to
make sure nothing is broken. For similar reasons I try to avoid ever
doing major changes on a Friday.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: greg@2ndquadrant.com, crucialfelix@gmail.com, scott.marlowe@gmail.com
Subject: Re: Really really slow select count(*)
In-Reply-To: <4D4FA496.8060206@2ndquadrant.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