Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP0A1-0001m7-DY for pgsql-general@arkaria.postgresql.org; Tue, 20 Nov 2018 07:09:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gP09z-00049e-Po for pgsql-general@arkaria.postgresql.org; Tue, 20 Nov 2018 07:09:23 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP09z-00049W-EF for pgsql-general@lists.postgresql.org; Tue, 20 Nov 2018 07:09:23 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gP09w-0003EJ-2w for pgsql-general@postgresql.org; Tue, 20 Nov 2018 07:09:22 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 16A5CA16B9; Tue, 20 Nov 2018 08:09:16 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id QAOIsEaOfplx; Tue, 20 Nov 2018 08:09:14 +0100 (CET) Message-ID: <489acb50e9f4cb043ec4797f338ae06e66c0287c.camel@cybertec.at> Subject: Re: replication lag despite corrective config From: Laurenz Albe To: Wyatt Alt , pgsql-general@postgresql.org Date: Tue, 20 Nov 2018 08:09:13 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2018-11-19 at 17:46 -0800, Wyatt Alt wrote: > I've been struggling to eliminate replication lag on a Postgres 9.6.6 > instance on Amazon RDS. I believe the lag is caused by early cleanup > conflicts from vacuums on the master, because I can reliably resolve > it by killing long-running queries on the standby. I most recently > saw ten hours of lag on Saturday and addressed it this way. > > The standby is running with > hot_standby_feedback = on > max_standby_streaming_delay = 5min > max_standby_archive_delay = 30s With these settings, any conflicting query will be canceled after five minutes. Perhaps your actual settings are different. What do you get for SELECT * FROM pg_settings WHERE name = 'max_standby_streaming_delay'; Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com