Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khZSV-0002J6-84 for pgsql-admin@arkaria.postgresql.org; Tue, 24 Nov 2020 14:38:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1khZSU-00004x-6T for pgsql-admin@arkaria.postgresql.org; Tue, 24 Nov 2020 14:38:18 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khZST-0008WU-Us for pgsql-admin@lists.postgresql.org; Tue, 24 Nov 2020 14:38:17 +0000 Received: from mout.perfora.net ([74.208.4.194]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khZSR-00020Q-Pk for pgsql-admin@postgresql.org; Tue, 24 Nov 2020 14:38:16 +0000 Received: from [192.168.1.165] ([72.205.30.64]) by mrelay.perfora.net (mreueus004 [74.208.5.2]) with ESMTPSA (Nemesis) id 1My3lb-1kIjLH1jg7-00zSvD; Tue, 24 Nov 2020 15:38:12 +0100 Subject: Re: Streaming Replication replay lag To: Nikhil Shetty Cc: pgsql-admin@postgresql.org References: From: MichaelDBA Message-ID: <3df84e65-5bef-53eb-fe76-248677ed37b6@sqlexec.com> Date: Tue, 24 Nov 2020 09:38:09 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.38 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Provags-ID: V03:K1:07ezlLFOwcIjjK5hXdSfiP5hd24OqkoPC2gOxFUb7frs1ivmV3W 6GEXijsV0ydMem2sv8o5FJsvZfGrzNyBNqW4/FA797kxnySrJ5cSOp5DWNCP0xbKGvrn+Iy l17DVkkbKMouwXEHXoNmA4sDJQ+QUACtSUJEWF2u/Qph2QxuVALK4Ce0K5Lr2z8cd+6TLbC TZeBI57SwtBY1l42yiSJQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:jnbQc69/hOI=:m4KN6Ml2t685D6DHsQpRj4 UmVDfiQ7V+YKuBGa0XBA94O5AA9PwolG5QuCSS4N46z7CCDndE68xJXYYG6Yipj8wJVzQPsc0 G3kIzDBb22Yh9PlBJjw4YgpBIY5KB3VZEPQGNV8MJa2GKiEyhRS94PP46p4p7TAZ7Ix40z0As r39FfXjenhWqzJZUmf/EJjfHesXHKFQI1Uu9Yp8iIN51lMgMWLGD6T2eLBKZsUqfJpQal9zcO 4xgolCytkHJ+kZ//XmBJ+bUE42AoUjUn8mwo2b45vuw7wHdFHjCUZrLV1hHZT8ePEGjzAD0c+ 3Ohpeh5i2S0VO1lEzrLaxKRa9OXiDql1gqA9aYkdzCn3x8zJynkaERWWhdcVIUhxscyRThRHu c1NISMzEZLGTE/8TI6oJmF0QTFp/aV80AjgF0DTHu/0WFQUcK2Zi+Uzs0oQmGJhG2b3sUIbBk hw6YFz1WnQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Check replication settings: max_standby_archive_delay max_standby_streaming_delay hot_standby_feedback These can delay wals being applied to the replica while queries are still running. Regards, Michael Vitale Nikhil Shetty wrote on 11/24/2020 9:24 AM: > Hi, > > We have one Primary and three Standby Postgresql setup. Two standby in > DC and one standby in DR. > > We have configured streaming replication.When there are a lot of write > transactions in the master, we observed that DR lags behind the master > for 5-6 hours. We initially thought this could be because of the slow > network between DC and DR and this is normal but when we saw the > replay_lsn and receive_lsn , they had a huge difference. > > DR standby was receivingĀ the WAL's in time and there was no delay, the > delay was in replaying the lag. Can anybody point me to where I can > start with the investigation? > DC (Master and 2 Standby) and DR(Standby) have the same setup in terms > of storage and some databaseĀ configuration parameters but DR has a > little less CPU and RAM. > > Attaching replay and receive wal difference. >