Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXJKd-0000Ik-PR for pgsql-performance@arkaria.postgresql.org; Fri, 18 Oct 2013 23:19:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VXJKd-0007on-5C for pgsql-performance@arkaria.postgresql.org; Fri, 18 Oct 2013 23:19:47 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXJKc-0007oh-9F for pgsql-performance@postgresql.org; Fri, 18 Oct 2013 23:19:46 +0000 Received: from mail.gransy.com ([2001:1528:137::f1]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VXJKZ-0002kb-RO for pgsql-performance@postgresql.org; Fri, 18 Oct 2013 23:19:45 +0000 Received: from antispam.gransy.com (antispam.gransy.com [77.78.104.124]) by mail.gransy.com (Postfix) with ESMTP id 6BA88508C3D for ; Sat, 19 Oct 2013 01:19:42 +0200 (CEST) X-Virus-Scanned: G-Hosting.cz + Station.cz + Klenot.cz + Subreg.cz amavisd-new at antispam.gransy.com Received: from mail.gransy.com ([82.208.44.189]) by antispam.gransy.com (antispam.gransy.com [77.78.104.124]) (amavisd-new, port 10024) with ESMTP id 5udviilfbRVR for ; Sat, 19 Oct 2013 01:19:42 +0200 (CEST) Received: by mail.gransy.com (Postfix, from userid 5000) id 3365F508C3F; Sat, 19 Oct 2013 01:19:42 +0200 (CEST) Received: from [192.168.1.227] (ip-78-45-139-138.net.upcbroadband.cz [78.45.139.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.gransy.com (Postfix) with ESMTPSA id 1B2F7508C3D for ; Sat, 19 Oct 2013 01:19:42 +0200 (CEST) Message-ID: <5261C20D.1020003@fuzzy.cz> Date: Sat, 19 Oct 2013 01:19:41 +0200 From: Tomas Vondra User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Hot Standby performance issue References: <1381869626548-5774673.post@n5.nabble.com> In-Reply-To: <1381869626548-5774673.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 15.10.2013 22:40, sparikh wrote: > Hi, This is my first post ever in the Postgres forum. I am > relatively new to Postgres and coming from oracle background. > > We have hot stand by setup to serve mainly the read only queries. > Past few days we have been facing a performance issues on one of the > transaction search. The search mainly utilizes 3 of our biggest > transaction tables. What do you mean by "transaction search"? > > We had recently crash on both primary and standby because of the > space issues. Both servers were brought up and running successfully > after that incident. The standby is in almost in sync with primary, > far behind by less than a second. I also rebuilt all the major > indexes on the primary. I have done some research work to address the > issue as following. > > (1) I checked most of the database parameters settings and they are > same on both primary and standby, except some specific to the > individual server. So, what are the basic paremeters? And what PostgreSQL version / OS / hw are we dealing with? > (2) Checked the explain plan for the offending query and they are > exactly same on both the servers. Checked cpu usage on unix box and > found it was quite low. Well, that's hardly useful as you haven't provided the query not the explain plan. Have you tried EXPLAIN ANALYZE? > (3) The load on standby does not seem to be issue, because with > absolutely no load the query takes long and most of the time > returned with the conflict error. Not suse I understand this. Are you saying that the standby is mostly idle, i.e. the query seems to be stuck, and then fails with conflict error most of the time? > (4) The hardware settings are exactly same on both primary and > secondary. So what are these hardware settings? BTW do you have some stats from the OS (CPU / IO / memory) collected at the time of the performance issue? > (5) The same query executes very fast on primary Query? Explain analyze? > (6) After we recovered standby it was fine for few weeks and then > again started slowing down. Was it slowing down gradually, or did it start failing suddenly? > I believe autovacuum and analyze does not need to be run on standby > as it inherits that from primary. Please correct me if I am wrong. Any commands that would modify the database (including vacuum and autovacuum) are disabled on the standby. > Any help or suggestion would be greatly appreciated. Thanks, Please, post as much details as possible. This reports contains pretty much no such details - query, explain or explain analyze, info about the settings / hardware etc. regards Tomas -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance