Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YMf9X-0001Dn-DK for pgsql-admin@arkaria.postgresql.org; Sat, 14 Feb 2015 16:01:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YMf9W-0006W6-OH for pgsql-admin@arkaria.postgresql.org; Sat, 14 Feb 2015 16:01:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YMf9V-0006W0-QP for pgsql-admin@postgresql.org; Sat, 14 Feb 2015 16:01:06 +0000 Received: from www.ipv6.roaringpenguin.com ([2607:f748:1200:fb:70:38:112:54] helo=colo3.roaringpenguin.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YMf9K-0006SZ-7k for pgsql-admin@postgresql.org; Sat, 14 Feb 2015 16:01:03 +0000 Received: from vanadium.roaringpenguin.com ([192.168.10.23]) by colo3.roaringpenguin.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id t1EG0ppo025038 for ; Sat, 14 Feb 2015 11:00:52 -0500 Received: from ollie.roaringpenguin.com ([192.168.7.79]) by vanadium.roaringpenguin.com (8.14.4/8.14.4/Debian-4) with ESMTP id t1EG0oRH015122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 14 Feb 2015 11:00:51 -0500 Date: Sat, 14 Feb 2015 11:00:50 -0500 From: "David F. Skoll" To: pgsql-admin@postgresql.org Subject: Weird spikes in delay for async streaming replication on 9.1 Message-ID: <20150214110050.2f032f05@ollie.roaringpenguin.com> Organization: Roaring Penguin Software Inc. X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=roaringpenguin.com; h=date :from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=main; bh=Fx7KGx8rdYzQE3WVaI4rE2fo/ Yw=; b=lqfAzuL9okaSHWuKtmaUh/8QW0uYHPheQbOxkiWP9Yy1UTY09vYZuj7jA 1Vs/gZZK2WpRkRlJNWt8byzOE8wVug0s1v+zloMO4Gpa+2vx9CoFqYZwAd+tdVZy NpMP+K8JRBkLkyRrYpFeJhUFie2lOc1lcxG+59IIXFxMFaVJxl4LzlYX5ysp0CYD L5NRptteVYnXfh80muASHtzuM57ZcAKP23n8bZMsm4nWM3wTFhtj1BSvpmJFtwX5 7ly8r1iobYiKkkUnh/4Aht+rhokcCY47GIWS8DXlkU+gwj7Yy5wPJdjFzlPHqe5o he9okZixkdwJKqwP8vwe+f5a30Akg== X-Scanned-By: CanIt (www . roaringpenguin . com) X-Scanned-By: MIMEDefang 2.75 on 192.168.10.23 X-Spam-Score: undef - relay 192.168.10.23 marked with skip_spam_scan X-CanIt-Geo: No geolocation information available for 192.168.10.23 X-CanItPRO-Stream: outgoing (inherits from default) X-CanIt-Archive-Cluster: SQVyZJxqklY5buiWXYCN4T/BjiM X-CanIt-Archived-As: base/20150214 / 01NQg0PSm X-Pg-Spam-Score: -1.0 (-) 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 Hi, I have a two-database cluster. The machines are geographically separated and the nature of my application is that many read-only queries can tolerate being "behind the times" by a few seconds. So machines near the hot-standby connect to the hot-standby for these delay-tolerant queries in order to reduce traffic over the relatively slow link between geographical locations. 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 I've tried to figure out what causes this, and the only events I can find that correlate are a pg_dump on the master and possibly some autovacuum jobs kicking off. So my questions: 1) Can a long-running transaction on the master block subsequent transactions from being consumed on the hot-standby, or am I totally out to lunch? 2) If (1) is correct, is it still true in 9.4? 3) If (1) is false, does anyone have plausibly explanations for what I'm seeing? I don't think it's the link between the sites, because we also monitor that and it seems to be fine. Regards, David. -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin