Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YR0YO-0001Lg-K4 for pgsql-admin@arkaria.postgresql.org; Thu, 26 Feb 2015 15:40:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YR0YO-0001Cp-28 for pgsql-admin@arkaria.postgresql.org; Thu, 26 Feb 2015 15:40:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YR0YM-0001Ad-N2 for pgsql-admin@postgresql.org; Thu, 26 Feb 2015 15:40:42 +0000 Received: from mail-yh0-x22c.google.com ([2607:f8b0:4002:c01::22c]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YR0YI-0005Fn-Ui for pgsql-admin@postgresql.org; Thu, 26 Feb 2015 15:40:41 +0000 Received: by yhaf73 with SMTP id f73so4854749yha.3 for ; Thu, 26 Feb 2015 07:40:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=8771Wai7Fke1jRzIm6/p+gaql1iV3LH03EDCEewJAdw=; b=KIdrjo1E/zzfxcTN+QonaNgY7DNRlhyX0HQy3rSOa9wefr4MlzPVdKKf26Ps9pCuMj uJtNiwMUJ6pGMcu2JWoo8NT3antbrzBGia7qWZxM/ZU//fVHRZ1T7bo6e8PgCkxqAdTa Qy8g2A6Z7mk3sNPk6zvaeWIBfKGO659LwaDwDr52H/vz5CB4q4YQdvWGAw1s1aqaJtZT 8NGB7Mk8lz2meIr/wLEyY7+VuFkbAC3FB0jW8catZ5E8mLITifW8xoIEAuctW9CsxDmC 0WZVQTpZJwfdDhhazJvL7pN7vKqA7/a5RMJakCBRMD3q65y0KT+DkrCreFkozvpPokRJ c+7g== X-Received: by 10.236.105.226 with SMTP id k62mr8524959yhg.175.1424965236647; Thu, 26 Feb 2015 07:40:36 -0800 (PST) Received: from [192.168.254.3] (h77.89.102.166.static.ip.windstream.net. [166.102.89.77]) by mx.google.com with ESMTPSA id e68sm802135yhb.26.2015.02.26.07.40.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Feb 2015 07:40:36 -0800 (PST) Message-ID: <54EF3E6F.60403@gmail.com> Date: Thu, 26 Feb 2015 10:40:31 -0500 From: John Scalia User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: "David F. Skoll" , pgsql-admin@postgresql.org Subject: Re: Weird spikes in delay for async streaming replication on 9.1 References: <20150214110050.2f032f05@ollie.roaringpenguin.com> <20150226094428.34531376@hydrogen.roaringpenguin.com> In-Reply-To: <20150226094428.34531376@hydrogen.roaringpenguin.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 2/26/2015 9:44 AM, David F. Skoll wrote: > Hi, > > I posted this a couple of weeks ago and no response... I guess it's > quite mysterious. > > Anyway, behavior is consistent. It seems that long-running > transactions on the primary (even read-only ones, because in my case > it's a pg_dump) can block subsequent transactions from appearing on > the hot-standby until the first transaction finishes. Is this a known > limitation? I run 9.1; is it still present in 9.4? > > Regards, > > David. > > ======================================================================== > [...] > >> I have a monitoring script that tests the actual delay for a >> transaction on the master to appear on the hot-standby. Every few >> minutes, my script runs an update on the master and then sits in a >> loop checking how long it takes to appear on the hot-standby. 99% of >> the time, it's less than a second. >> But every once in a while, the time spikes dramatically, to hundreds >> or thousands of seconds, and that's too long... the delay-tolerant >> queries are not *that* delay-tolerant, so we switch to sending them >> all to the master. >> See the graph: http://ibin.co/1rdm4ekiWmpM > [...] Apologies, David, but as I don't check this list very often, I thought you should have received an answer. Have you tried watching the transaction with tcpdump or wireshark? To me this sounds like either a network problem or like you're thinking a contention problem. Also, are you running streaming replication? If so, there shouldn't be ANY delay as the standby gets the commit before the primary. Otherwise, how are you replicating? -- Jay -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin