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 1upSpL-005eya-An for pgsql-general@arkaria.postgresql.org; Fri, 22 Aug 2025 14:33:12 +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 1upSpJ-006TRC-Rb for pgsql-general@arkaria.postgresql.org; Fri, 22 Aug 2025 14:33:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1upSpI-006TR4-Sj for pgsql-general@lists.postgresql.org; Fri, 22 Aug 2025 14:33:10 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1upSpG-001CnS-1c for pgsql-general@lists.postgresql.org; Fri, 22 Aug 2025 14:33:08 +0000 Received: from phl-compute-09.internal (phl-compute-09.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id EEFCA1D0000F; Fri, 22 Aug 2025 10:33:05 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Fri, 22 Aug 2025 10:33:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1755873185; x=1755959585; bh=jk4zp+ZvTpEGwGZLce31Oq2LgS3XhKym/SmeIKcHX48=; b= sE1TYg7WYCdZz7o8ZGEwFKX9fhd5zNmHljwLKPKjBUWllT0t2wPJGiX/h6eSG5W3 75eQ5aAOMI+5eAjpkhlpjaSpZOh3UKgwFZhOKSFZ1Ycczk95oSFgX34OMmfstkfo dz0nm6dsHVYV01LE/8AtAAGfpyPOwkAVCwtLkBDUh39XMVu4CWBBU+0WkS19JVP2 CJaGr2zmdSw0TGgfkca8SLfvlJZIO0fs3x8R9VKbI/yWaETLpJnbGOl4HwPWkFom mvpzV+CkPj4rK+ldsj4N3svM+v4l+Y81QL1oHyOuSysUvXIB+j+C7DuZ9kPr5ajU C2OIm6KBQWvcI1l4735GJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1755873185; x= 1755959585; bh=jk4zp+ZvTpEGwGZLce31Oq2LgS3XhKym/SmeIKcHX48=; b=L PLByYQt8k7oHQfmy3ql1RxC3/57aIR+ZgmYSRgv/Mv54B/johQ1fqJufkqGjgOqK Cy/RvO8TteQH9eqEARSzVz3MQ2TRZ4pHb2myvEOL2LCI+zHg6hASD6NERUYWeKur NnPQAUPjUFf+o+Oty5OVrrG0h+eT8Ht7ZfNavY7ZtWHVLA3PS2bk+LqpEq5SSYeY 8bPyt3tigyBf4YqMLPh/lg4xk1Dn3TBUTj4ngNoPaATIIGBh6+mBrvauzYGBUEfm fT6Gp7VAewJpE8T1nhuL7jjF6Y457f7z21KrwWPkOoXIVzf+8o2iVbUpJlQktq6S JERZSk+TwbKm24t0zZFNA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduieegtddtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepgfdugeejiedvffeiudfgvddvfedttddthfetiedtgeei veekieehheeghfeileeinecuffhomhgrihhnpehpghgsohhunhgtvghrrdhorhhgpdhgih hthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhl fhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmpdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeguvghpvghsiies uggvphgvshiirdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlheslhhish htshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Aug 2025 10:33:04 -0400 (EDT) Message-ID: Date: Fri, 22 Aug 2025 07:33:03 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug To: depesz@depesz.com Cc: PostgreSQL General References: <05969854-0d19-4726-ae1b-586659dd443b@aklaver.com> <25334887-f1c3-40a1-94b0-753c7d67ae2b@aklaver.com> <2a3e4a8d-e8c2-46d6-ad7d-9e631ce6725e@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 8/22/25 05:37, hubert depesz lubaczewski wrote: > On Thu, Aug 21, 2025 at 11:17:27AM -0700, Adrian Klaver wrote: >> Have you looked at?: >> https://www.pgbouncer.org/changelog.html#pgbouncer-124x >> To see if anything stands out. >> Then there is: >> https://www.pgbouncer.org/config.html#max_prepared_statements >> The below may also be worth looking at: >> https://github.com/pgbouncer/pgbouncer/pull/1144 >> I can't help thinking that there is a caching issue at stake, though that is >> just a guess. > > Will check, but we don't use prepared statements, so this doesn't seem > to be part-of-the-problem. In your OP there is: "Every now and then (usually every 3-5 minutes, but not through the whole day), we see situations where every query suddently takes ~ 1 second. I'm talkign about "prepare" for preparing statements. binds. also "discard all". " Is that referring to something else? > > Best regards, > > depesz > -- Adrian Klaver adrian.klaver@aklaver.com