Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5172E632672 for ; Sun, 4 Jul 2010 09:38:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 39946-02 for ; Sun, 4 Jul 2010 12:38:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id 033C26322F5 for ; Sun, 4 Jul 2010 09:38:45 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id 95A48A20C; Sun, 4 Jul 2010 20:38:42 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 985FBAFD73; Sun, 4 Jul 2010 20:37:23 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0OPGq5986hHY; Sun, 4 Jul 2010 20:37:18 +0800 (WST) Received: from [10.1.1.6] (124-168-255-56.dyn.iinet.net.au [124.168.255.56]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 2BB0AAFD71; Sun, 4 Jul 2010 20:37:18 +0800 (WST) Message-ID: <4C3080CC.1010300@postnewspapers.com.au> Date: Sun, 04 Jul 2010 20:38:36 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: Sachin Kumar CC: pgsql-performance@postgresql.org Subject: Re: Performance issues with postgresql-8.4.0 References: <21026437C2BC0D45BE196CB0A35EFEFD052700D7@ex2-del1.synapse.com> In-Reply-To: <21026437C2BC0D45BE196CB0A35EFEFD052700D7@ex2-del1.synapse.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.79 tagged_above=-10 required=5 tests=BAYES_50=0.8, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201007/47 X-Sequence-Number: 39436 On 29/06/10 15:01, Sachin Kumar wrote: > At times we have observed that postgres stops responding for several > minutes, even couldn't fetch the number of entries in a particular > table. Quick guess: checkpoints. Enable checkpoint logging, follow the logs, see if there's any correspondance. In general, looking at the logs might help you identify the issue. One such instance happens when we execute the following steps: > > - Add few lakh entries (~20) to table X on the master DB. > > - After addition, slony starts replication on the slave DB. It > takes several minutes (~25 mins) for replication to finish. > > - During this time (while replication is in progress), sometimes > postgres stops responding, i.e. we couldn't even fetch the number of > entries in any table (X, Y, etc). Fetching the number of entries in a table - using count(...) - is actually a rather expensive operation, and a poor choice if you just want to see if the server is responsive. SELECT id FROM tablename LIMIT 1; where "id" is the primary key of the table would be a better option. -- Craig Ringer