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 1tfhTU-004QO8-Kx for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 15:38:01 +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 1tfhTT-00FLCT-EP for pgsql-general@arkaria.postgresql.org; Wed, 05 Feb 2025 15:37:59 +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 1tfhTS-00FLCL-Os for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 15:37:59 +0000 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tfhTO-003Vuk-1W for pgsql-general@lists.postgresql.org; Wed, 05 Feb 2025 15:37:58 +0000 Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id C536613801DA; Wed, 5 Feb 2025 10:37:52 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Wed, 05 Feb 2025 10:37:52 -0500 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1738769872; x=1738856272; bh=M +3jpl6AausJ7UGYQ0EpiJqOupFbRYnIlgCzMAI4GIM=; b=qPUeWU5B8OpDjTdkS RzT+9SHqqOCUnGjlIWC3Yv2bBOuLkSl7QjYEF7rlfiz1rfVGoFITHDmTCYFLrlw5 on5irNdHR9lFK/ljWOd1fT3GFmnRkO8DD0X7qOkFd68hdEKWSvIdtmxKSEiG7zFo E+rBNUPYGnI3LOmoLUHSDNQW/4/OgUAvRfnuhFsVxlY9IsOPfYBHxjEDJag4mBo+ a8OCD3YqPClAzKbtumzxNqs5YC0dILpfNpBNkOW2xH/z6AtwDodsm2k8KAIL7iu1 EJd/bYGuOfJRuTgoEbRvd4UdM+L2A0fQmiHsRnOnJ+f9AGXjsLhiwCwra5Fzfzgr S48Xg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeekgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvf evuffkgggtugfgjgesthekredttddtjeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgv rhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrth htvghrnhepvdehueffhefgueekueefheehgffhuefgfedukeejveduffegffekgeffffev geehnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehrrghmrdhpghgusgesghhmrghilhdrtghomhdprhgtphhtthho pehrrghvihhsqhhltdelsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqgh gvnhgvrhgrlheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 5 Feb 2025 10:37:52 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1738769871; bh=ZQNfdIJ48S8TELiO9LfsrNm05cUnpMlrZIWN34uT/ZQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=WVTdhhq2RxX4P4O9+jtrtBeeDo8o7FZx4dhbUV8n2MHEQ06jgNgiDRFmZj7B/ieoA +tfY8DWp0rvskXoa5JsRxLy1D3zaD8BApVD2s+zPCRRofpIZvkdpAse18Hf+dh6Jhk UOXQSf8dEDqC6BhwY7JLb/JFOE4fo/kAVOlzmig7KUAN6/dz2YCyDj2Q4JOP/n/Of7 ei2gNH/QvF/egXrjVLwnDZ/tJ2sBHs3lrgUErST3qgOiR9N06Vwl+u++31Cnzvrb1o B2srdisDcPEZtrdgVt5SN6k/VbrQBki3N7aQzETEBOB4iXZIQW0GN1do/6lwuAB4vT 606KymJb981Zg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id F3B5190; Wed, 5 Feb 2025 16:37:50 +0100 (CET) Date: Wed, 5 Feb 2025 16:37:50 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Ramakrishna m Cc: pgsql-general@lists.postgresql.org, ravisql09@gmail.com Subject: Re: Commit Latency Message-ID: <202502051537.rpohgrxu4vrz@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello On 2025-Feb-05, Ramakrishna m wrote: > I have a system handling *300 TPS*, with resource usage *below 10%*. > However, I’m noticing *commit latency of around 200ms* for *1% of > transactions*, occasionally spiking to *1 second*. Since there is no > significant *I/O pressure*, I’m trying to identify what else might be > causing this in *PostgreSQL 16*. max_connections=8000 doesn't sound great -- how many of those are active, typically, and how many are idle-in-transaction? And you have autovacuum_naptime=5s ... which sounds rather dubious. Either somebody with great expertise configured this very carefully, or the settings are somewhat randomly chosen with little or no expert oversight. Do you have monitoring on the amount of bloat on these database? Maybe you should consider connection pooling and limit the number that are active, for starters. Maybe have a look at whether pg_wait_sampling can give you more clues. Some basic bloat monitoring is a prerequisite to any further performance tweaking anyhow. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ Maybe there's lots of data loss but the records of data loss are also lost. (Lincoln Yeoh)