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 1kfk9I-0006q2-MR for pgsql-performance@arkaria.postgresql.org; Thu, 19 Nov 2020 13:38:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfk9H-000873-Kc for pgsql-performance@arkaria.postgresql.org; Thu, 19 Nov 2020 13:38:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfk9G-00086w-L1 for pgsql-performance@lists.postgresql.org; Thu, 19 Nov 2020 13:38:55 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfk9C-0001Do-BF for pgsql-performance@postgresql.org; Thu, 19 Nov 2020 13:38:54 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 33D9F5C00B2; Thu, 19 Nov 2020 08:38:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 19 Nov 2020 08:38:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imap.cc; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=p Sza3B3T6aV4ZP63lT4B1JkiDpxC0QxAyglHpQlnDrw=; b=I04xhHtgMoMOO4Uyd WF6BvsJurc/xkHnnskw/gq4xMl21OFS9F5nRouJpBmWLWTb0923J2iko7Dy6yF6b n4KdaY8a3PRbmorm43j7S7HGlBzZS8OPKabClbjbEO64l4QDJoLy1uVfCh7ihdim aWgJXSWyeg54CcHQTKsfOla/4kECRpZNttipvwnWVIuraeLNSx7KSgkNIFp+Q1cP +7IcbNen10vTiCTj0GfqWCR3fg14f9LebIchWy2Jf14I8+kKiKQQSM5eNizxSnCI vyk31j887rSBUfI+4f0JSbpybjYIy2SL1eb0y71cIZGB3Uv2c3SSgujrqYD7g1++ Yx2vQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=pSza3B3T6aV4ZP63lT4B1JkiDpxC0QxAyglHpQlnD rw=; b=rfMimDIYnFfnOlc0GrtvJwawiZkCJS3RQm9T5qVxgjCOF8p3h7DoLrRTx s0rHAMKlfoYsvsKObgZNibYj3NiXAWXJJjYfaBOJELSB2UQwabcPy9rr3BuFVp1I 5oDz65nxfdi43iHQp/kFA5AfRibDzfCmRbjGmrtPA16M0xYaOsYF2KFznYBLCXMd nUfp569ObITdU17+mKv6NJzdse8ReSdNlh2HOmKtaXxv2oSxd+oNerc/4oARP9Fc Cf8CyXmNrbEmT0cEKQfIJU/32lKphEkyo6iYViLY7/WWlBEeSw7NxmPplJyaIUFZ UzGOtCgCCOsXRSC/1b2dLDphbU03w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudefjedgheegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfedtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddt feejnecuhfhrohhmpeetlhgvgigvhicuuegrshhhthgrnhhovhcuoegsrghshhhtrghnoh hvsehimhgrphdrtggtqeenucggtffrrghtthgvrhhnpeefheeludduveefvdeitdejgefh ieevleehjeeludffjeduueelffffhfevjeeuhfenucfkphepkedtrdeggedrudduiedrvd duheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegs rghshhhtrghnohhvsehimhgrphdrtggt X-ME-Proxy: Received: from ev9d9.btn1.brandwatch.net (80-44-116-215.dynamic.dsl.as9105.com [80.44.116.215]) by mail.messagingengine.com (Postfix) with ESMTPA id 69C1D3064AB5; Thu, 19 Nov 2020 08:38:47 -0500 (EST) Subject: Re: How to prioritise walsender reading from pg_wal over WAL writes? To: Laurenz Albe Cc: pgsql-performance@postgresql.org References: <774ec1b8-c7c6-cfa2-098d-5c6a32dcfc1a@imap.cc> <6a3a9ef99167a7baeaeee3d3df4af59694277e36.camel@cybertec.at> From: Alexey Bashtanov Message-ID: <754ba288-1c2c-a4b4-0fb3-38fbc03053fd@imap.cc> Date: Thu, 19 Nov 2020 13:38:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <6a3a9ef99167a7baeaeee3d3df4af59694277e36.camel@cybertec.at> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > I would first determine where the bottleneck is. > > Is it really the walsender, or is it on the network or in the standby server's replay? It is really the walsender, and it really is the performance of the WAL storage on the master. > Check the difference between "sent_lsn", "replay_lsn" from "pg_stat_replication" and > pg_current_wal_lsn() on the primary. Yes I've checked these numbers, the lagging one is sent_lsn. It doesn't look like it's hitting network capacity either. When we moved it to an NVMe as a short-term solution it worked fine. Best, Alex