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 1t8T8y-004Ofe-TA for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2024 23:39:28 +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 1t8T8w-001gig-8b for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Nov 2024 23:39:26 +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 1t8T8u-001giY-QS for pgsql-hackers@lists.postgresql.org; Tue, 05 Nov 2024 23:39:26 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t8T8s-000Nep-50 for pgsql-hackers@lists.postgresql.org; Tue, 05 Nov 2024 23:39:24 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 8ACCB1380554; Tue, 5 Nov 2024 18:39:20 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Tue, 05 Nov 2024 18:39:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=fm3; t=1730849960; x=1730936360; bh=EWdS4SUWmQ im01et6X1lqRCl18UJElKilsYiby92DTI=; b=VBAPqwR1iPLS6cC8BzVmGsXAEy YvXi732K5T9V2LgjFirSU2hYtY9wRsVp7tYyYc4QX3bNedUf4ZB7cg3xpL87dPMs 7LyqirJAlv3fKbOUFsEpdKlD2k6efGJSgp4BMvkw37GAXNDLsR9aNGuas3VCEVjd +0ImUrO6Dzx9ZFlmIxaXIEwV6SJxBOueM8fWia6OIilPc6meWh4EoFnXx0MNuoY3 W4AJhr21CzlMRTdleztOWjqNU7dL45oFPPGslE+HpY+dDc7r7b5NaZgkjsAElqRY yE4dYt74nXRBvEavrFh38OYXNJi+/APcc1QFyU84wncpV1tMnGuJ9xGUlJjg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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= 1730849960; x=1730936360; bh=EWdS4SUWmQim01et6X1lqRCl18UJElKilsY iby92DTI=; b=HZi5U+ZqqHKrnNEy7ngbKI71hoQBsqpfzKpZX/MjRcaQrGUkb95 5On6rsbJ77XSrm3WybJYtF59NOrYt/i30gwpsi0G4rGWBvHBwsb/5x4ZWZQpw1D8 3XNz6H/cXVuWrHBuZDkoq9BDmplQs0Hnc8FA2X47ZyuRkAwo8T694YN+FFsn8V5u +OaCrCctQUKHzfwBJkA/6aFaaf33inZj/1RwNblUyAOMqSiss1WOZnPvA+hvh7Ck 2tOuIlnT4KsQllU5Oa8bPSARBdyhc7ZyX9Tl9V0FGLtXFLoQWMTJW3k/Ms+fdx5s vwBh0HUSlQtmuiNJKIhwcLF9zru11ms+e2g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrtddugddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenfghrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhgg tggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoe hmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeegffej vefgveduvdejtddvtdeijeehudeuledvudeftdfgfeejvdekveekiedvvdenucffohhmrg hinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidpnh gspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepsggvrhht rhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsgihrg hvuhiikedusehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghlvhhhvghrrhgvsegrlhhv hhdrnhhoqdhiphdrohhrghdprhgtphhtthhopehhohhrihhkhihothgrrdhnthhtsehgmh grihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdr phhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Nov 2024 18:39:18 -0500 (EST) Date: Wed, 6 Nov 2024 08:39:07 +0900 From: Michael Paquier To: Bertrand Drouvot Cc: Nazir Bilal Yavuz , Alvaro Herrera , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: per backend I/O statistics Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SQ0ywFv/uUZpKN9n" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --SQ0ywFv/uUZpKN9n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 05, 2024 at 05:37:15PM +0000, Bertrand Drouvot wrote: > I'm starting working on option 2, I think it will be easier to discuss wi= th > a patch proposal to look at. >=20 > If in the meantime, one strongly disagree with option 2 (means implement = a brand > new PGSTAT_KIND_BACKEND and keep PGSTAT_KIND_IO), please let me know. Sorry for the late reply, catching up a bit. As you are quoting in [1], you do not expect the backend-io stats and the more global pg_stat_io to achieve the same level of consistency as the backend stats would be gone at restart, and wiped out when a backend shuts down. So, splitting them with a different stats kind feels more natural because it would be possible to control how each stat kind behaves depending on the code shutdown and reset paths within their own callbacks rather than making the callbacks of PGSTAT_KIND_IO more complex than they already are. And pg_stat_io is a fixed-numbered stats kind because of the way it aggregates its stats with a number states defined at compile-time. Is the structure you have in mind different than PgStat_BktypeIO? Perhaps a split is better anyway with that in mind. The amount of memory required to store the snapshots of backend-IO does not worry me much, TBH, but you are worried about a high turnover of connections that could cause a lot of bloat in the backend-IO snapshots because of the persistency that these stats would have, right? Actually, we already have cases with other stats kinds where it is possible for a backend to hold references to some stats on an object that has been dropped concurrently. At least, that's possible when a backend shuts down. If possible, supporting snapshots would be more consistent with the other stats. Just to be clear, I am not in favor of making PgStat_HashKey larger than it already is. With 8 bytes allocated for the object ID, the chances of conflicts in the dshash for a single variable-numbered stats kind play in our favor already even with a couple of million entries. [1]: https://www.postgresql.org/message-id/ZyMRJIbUpNPoCXUe@ip-10-97-1-34.e= u-west-3.compute.internal -- Michael --SQ0ywFv/uUZpKN9n Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmcqrJsACgkQnvQgOdby QH1CAA//dqWiZo9g+GZZLO5HeJM6QqWWLuxwHjpQ67D9LYUH2ATx5bIFIc0wJQI9 hvz5erDu520zOIm4k5sHAzGFr3DfidUE5mK6mbVCsi/PPJXoI8qqe+ypoAY5vp8k BqOqmur1G6k8KPUP6APvmM/LvvwdR4RBbDXaDz+t64k1wHDR7Qf0jW01LO/05SPw XtU2fGYG58NBXhORY4cT8LeyhOp7nTJU6mDIN9cVRK3TEhuj8GuJqQpYe0mLA0Ld lu/M70RUaZh6iX06SEUASNuL49cR/67FPxnPvXvPN2tT5TvFMoLSyLfKRgY0wOog 2/0UjeESPGI5QZ/dq92QJZCq8qcLF/2rKZWAbLp+E0iPpq347oR4yji4nA8hu65j IQBLXsN/HXgVuvpi5s0qsIo562xRLYJYg0sD0fOGe0CepxB/tbpU53Zv1g1MvN8a XpfaUKWAiBlSY93HmQdGgNZoFZOEDDUwVa8T89ZKA96tGDkr4D1RkaUj5tH+sZ71 kgIjh1gcdaYstNyFiFNPWLOIjtYIxFY0n3HShK+CvVtopCbuzTSXTIozox5JokiC ss7W8sFd5PB10ScCh7JME4pl1egIq5CY2o51ZkB6rjtxikgCwe/bKu6FHt3Giusx NP1s+eRNQs3j5bvYV7i3tDUhbVQWi7qhL0tKcF+5tZbESilgRK0= =WQb+ -----END PGP SIGNATURE----- --SQ0ywFv/uUZpKN9n--