Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzSYp-0049Ub-05 for pgsql-general@arkaria.postgresql.org; Wed, 24 Apr 2024 02:40:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rzSYn-00BIFW-4N for pgsql-general@arkaria.postgresql.org; Wed, 24 Apr 2024 02:40:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzSYm-00BIFN-Pn for pgsql-general@lists.postgresql.org; Wed, 24 Apr 2024 02:40:36 +0000 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rzSYk-002cze-Mr for pgsql-general@lists.postgresql.org; Wed, 24 Apr 2024 02:40:36 +0000 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-22f746c56a2so2865260fac.0 for ; Tue, 23 Apr 2024 19:40:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713926432; x=1714531232; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+EQQ3+tMp8fr5ceHX98r66ObL95JO5IGmgt96uVbJ0w=; b=jJrWqk8+R+5SnPamOB0IKH2MnbUOFfeU5aYhsqGYHPA31b6aTipKbNTxFXWULacHia VUe6QwWYpmObHV25Mr2zzOdSlZoN56oWZSdU35XiFlkX0+Raa/6ENBWUxSKTFveEOM6S JERNgRz6FYNLVtmM02kRroSowLqB9sLXiobqdSM2fOmKp2V8DBRhKAgPAreobYyPUPAc 0IBEG1kxmEVoweIYijt1lM4xf+xIuTRVastgkD8J78/YrNYWHVhsq/6fl9w+jUTndc4/ lAMXQeZWLHtY7O8aSByEoxFvGkDeGPMuWsok6V1Aw3+2+lK5+RSeW1Y/sA7PHavmJDG+ ymwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713926432; x=1714531232; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+EQQ3+tMp8fr5ceHX98r66ObL95JO5IGmgt96uVbJ0w=; b=LC3TcywTSHF8aBXZEZQLyAyailyy8xIt7QTSLvlUKjgU9+6wQPlbdIyKW7eAfbJIv4 +dpF2cqdvWKHchAvUdsLhba44FoSJCFM1UFfPhwrdKiQsSZlopcNm67lM3FLl/QoQBbB Mz3eteRkIKrlS1f6WWDfRbQY/xVnZj6Y8ROpNFLQ26SPTT08FWoxBbuhKWL/qBU4LRin 34nqIO2lehPA3LySiccqwRNfZVI2nTm5q4NeofQPCuxC2JdiypABvaqUac39jFe9K43S RK6F8uiXUmj4TzT2SeeSdlgsvfnVaYXPpPoMwQN6NorNZqHkNHJNNV434KLXEJWPelUP vRFw== X-Gm-Message-State: AOJu0Yzwrkpci9C4H33z4Qv+6KYw2O/dsOpATlQHUTg2WYJ/zvGR7URG nIY5ZVq/Z9ov0iXvHQdfOpaqC8Tv3jwGWcKr+ARxYRn2YVeXuoV0mE5wWJgZnVmvKNccqk+aTrc 6Qdy6hzaZP2/VqTyEaGznytKe4eqiDLQt X-Google-Smtp-Source: AGHT+IHEd2haRLd/ABTm1iuw0KSMLDRRfv4cl2WmgJkSp3goH7b1cx4XOaycEOUAdhi4du0T0kpk0xRgQDHtTfuMus8= X-Received: by 2002:a05:6870:a3d1:b0:21f:412a:87a8 with SMTP id h17-20020a056870a3d100b0021f412a87a8mr1426854oak.41.1713926432318; Tue, 23 Apr 2024 19:40:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ramakrishna m Date: Wed, 24 Apr 2024 08:10:20 +0530 Message-ID: Subject: Re: Logical Replication Delay on Remote Server To: pgsql-general@lists.postgresql.org Cc: ravisql09@gmail.com Content-Type: multipart/alternative; boundary="0000000000002b6a630616ce9843" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002b6a630616ce9843 Content-Type: text/plain; charset="UTF-8" Hi Team, adding one more point here, 5. Pg_stat_replication_slot total_txn count reduces when lag occurs .Does decoding stop in case of logical replication delay? On Tue, 23 Apr 2024 at 22:55, Ramakrishna m wrote: > Hi Team, > > I am facing replication lag in postgres16 at times,not able to find the > reason. > > Please find the configuration: > 1) Two replication slots for two servers (1 is the same data center, > another remote) > 2) weekly once/twice facing lag(around 2GB for 1k TPS environment) in the > remote replication slot and another same data center server slot with 0 > lag. > > My observation: > > 1) Noticed pg_stat_replication_slot total_txn reduced from 1k to 5 or 6 > but other slot is same with 1k TPS > 2)And noticed lag for remote slot but fine with same data center > 3) Most importantly I have plenty of Bandwidth available in n/w ,2GB is > still freely available out of 4GB network. > 4)No IO issues on servers > I am not able to prove if this is due to Network .Can you help me how to > proceed on this? > At Least how the logical decoding total_txn is counting the view > pg_stat_replication_slot? > > -- > Thanks & Regards, > Ram. > -- Thanks & Regards, Ram. --0000000000002b6a630616ce9843 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Team,

a= dding one more point here,

=C2=A05. Pg_stat_replic= ation_slot =C2=A0total_txn count reduces when lag occurs .Does decoding sto= p in case of logical replication delay?


On Tue, 23 Apr 2024 at 22:55, Ramakrishna m <ram.pgdb@gmail.com> wrote:
=
Hi Team,

I am facing=C2=A0replication=C2=A0lag in postgres16 at time= s,not able to find the reason.

Please find the configuration:
1) Two=C2=A0replication=C2=A0slots for two servers (1 is the same data center, another=C2=A0<= span>remote)
2) we= ekly once/twice facing lag(around 2GB for 1k TPS environment) in the=C2=A0<= span>remote=C2=A0 =C2=A0replication=C2=A0slot and anoth= er same data center=C2=A0server=C2=A0slot with 0 lag.

<= /font>
My observation:

1) Noticed pg_stat_replication= _slot=C2=A0total_txn reduced from 1k to 5 or 6 but other=C2=A0 slot is same= with 1k TPS
2)And noticed lag for=C2=A0remote=C2=A0slot bu= t fine with same data center
3) Most importantly=C2=A0I have plenty of B= andwidth available in n/w ,2GB is still freely available=C2=A0out of 4GB ne= twork.
4)No IO issues on servers
I am not able to prove if this is du= e to Network .Can you help me how to proceed on this?=C2=A0
At Least=C2= =A0how the=C2=A0logical=C2=A0decoding=C2=A0total_txn is counti= ng the view pg_stat_replication_slot?

--
Thanks & Regards,
Ram.


--
Thanks & Regards,
Ram.
--0000000000002b6a630616ce9843--