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 1sy27Z-00Ds3L-PU for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Oct 2024 04:46:54 +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 1sy27X-002nLH-Ol for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Oct 2024 04:46:51 +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 1sy27W-002nL9-EC for pgsql-hackers@lists.postgresql.org; Tue, 08 Oct 2024 04:46:51 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sy27T-0038Sn-Ek for pgsql-hackers@lists.postgresql.org; Tue, 08 Oct 2024 04:46:49 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id ADFDB114026B; Tue, 8 Oct 2024 00:46:45 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Tue, 08 Oct 2024 00:46:45 -0400 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=fm2; t=1728362805; x=1728449205; bh=0EdVr0kF9r +GdcKwX3XPfsbdy7DbsjY/zJYW4DyEyTc=; b=xxGXpoTC5oh3sDkaU/roOA1nYa KFGGGN8WJn9EtYX+qTdcyKXSxGFO+iDCThPT8++ltdDuL50/q3ol9Cz0udWlpaBY kthmujJUa022u4ToUA8rERdJBImzoSv4ALMyb6DZF7GtPMBMMkcqqkeb9BeZjNr6 XUzS5P/hCpt7CyYrDx4gTKBV48UatrE6v7VvKxPykn8De/2eg75S27p6PcChQeER Z0w9ixIahUyCgw7pvmExDL7XO3nSPnb9pJN3XBqYoMSNrnxCfKR9MxbJ5zvCyLLw nJa+fZrrOYQOn/CA27QIJRC0eDcBDDnYIWpyNRPofIqHjGvGPG2NBgJsyj6A== 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-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728362805; x=1728449205; bh=0EdVr0kF9r+GdcKwX3XPfsbdy7Db sjY/zJYW4DyEyTc=; b=ihTIOZVJvLAC1ID5R3MmSFMO8/st76h0eI2ToIZZpuuV /pRPpxbq9zTR/Ab0NRMs3zcMJOeZ2kcn/SzC6GQxoPAAGeqHCBUHRfK0GdraSC+0 jpu6YWZlIxW4dF4k3jQmAoFjSqA/84aSkwpu3sw4r32hgIZupXz5hN/acMAWvdTv eDtVn4gF6+vSIDfuQ3GOLaGZ5l4pODgKoyKc0tx1jiBugmLpCP3GIIJo5MTX3bgr isa0XpgZ7YxdH/GwpqhW7uGb0N/u5cmzttXNzyKD3rV8fhbLK7SOObWFkLZmtAXW PWoARPe2Co4EQB7wWtilwVkl9IibtN1clon/QVpSLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeftddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnegfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhf gggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruc eomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteel ieefudffhffhtdetleeggeegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhes phgrqhhuihgvrhdrgiihiidpnhgspghrtghpthhtohephedpmhhouggvpehsmhhtphhouh htpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepsgihrghvuhiikedusehgmhgrihhlrdgtohhmpdhrtghpthhtoh eprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrghdprhgtphhtthhopehhohhr ihhkhihothgrrdhnthhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhh grtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 8 Oct 2024 00:46:43 -0400 (EDT) Date: Tue, 8 Oct 2024 13:46:23 +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="CNk3c00+8X2AgAn7" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --CNk3c00+8X2AgAn7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 07, 2024 at 09:54:21AM +0000, Bertrand Drouvot wrote: > On Fri, Sep 20, 2024 at 01:26:49PM +0900, Michael Paquier wrote: >> This would rely on the fact that we would use the ProcNumber for the >> dshash key, and this information is not provided in pg_stat_activity. >> Perhaps we should add this information in pg_stat_activity so as it >> would be easily possible to do joins with a SQL function that returns >> a SRF with all the stats associated with a given connection slot >> (auxiliary or backend process)? >=20 > I'm not sure that's needed. What has been done in the previous versions is > to get the stats based on the pid (see pg_stat_get_backend_io()) where the > procnumber is retrieved with something like GetNumberFromPGProc(BackendPi= dGetProc(pid)). Ah, I see. So you could just have the proc number in the key to control the upper-bound on the number of possible stats entries in the dshash. Assuming that none of this data is persisted to the stats file at shutdown and that the stats of a single entry are reset each time a new backend reuses a previous proc slot, that would be OK by me, I guess. >> The active PIDs of the live sessions are not stored in the active >> stats, why not?=20 >=20 > That was not needed. We can still retrieve the stats based on the pid tha= nks > to something like GetNumberFromPGProc(BackendPidGetProc(pid)) without hav= ing > to actually store the pid in the stats. I think that's fine because the p= id > only matters at "display" time (pg_stat_get_backend_io()). Okay, per the above and the persistency of the stats. -- Michael --CNk3c00+8X2AgAn7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmcEuR8ACgkQnvQgOdby QH0I0Q//QA9kMICf11jNomddXw5sx5CiJyvuHPmRX97X1b1EjoqEPPFhumnHUnii nZ/D/tjLXNbce1GgcqygDiXurSn/z+lfDPaTmTXWWhBeC0KRWjXMiasbfOjIiw4z H1hhAwPxaaGxLFcz4j6xMmVa6Bk3wvy2jZ0iKJ/21251nJfows7yVYQPAxUbMiUV ONnApe/lOix+1in25iuck8vX1KaJ0WOVLUhTKUZEu/7L5Mo7XMOX5CgonJm+mpV8 fbNgBZPEFdr2fNB4jRa6zQagbOro2bXvooFwwmrd7zm1eQNS744GYBeSVVgTwj05 YRni8W7QPJgWHEbURvlyj2ixJdRhlkhl/jJplJAkBTHU7Ulp2qRBCNHPY/KxKK0d eFrVszPKwxuR12I4ZyRy395b27AhL1tROCSKhSVOoZf+zgZSvSt7UAASaylopVW+ GdicETNmdJUEU4OvF0W4mbZny8A6esNowhaSNrjy9nUDRMIBhqTCrRraieIF+8Ps rl417ceYk5LH5r9J51YTLP2mWj4p2YUAb3D6tIoWojeu4INKCkiZO/W2+Npn5zs+ 88sDjbCEcJ8AWgWAXjI1tUOXsgEfID561HqL6jMtaMZ/wKGziMYLGHg/TsmMxhYD 21qCw4e0dI0II0S+T+e/Ay+98u0q8z46aydXRG6mrH0Kb6/NX+8= =DaP/ -----END PGP SIGNATURE----- --CNk3c00+8X2AgAn7--