Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jF3uN-0005s2-CI for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2020 22:44:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jF3uM-0003Ai-1u for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2020 22:44:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jF3uL-0003Ab-Ou for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2020 22:44:57 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jF3uI-0004Se-5m for pgsql-hackers@postgresql.org; Thu, 19 Mar 2020 22:44:56 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 0F35969B for ; Thu, 19 Mar 2020 18:44:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 19 Mar 2020 18:44:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:subject:message-id:mime-version:content-type; s= fm1; bh=wayncnA+h39jYfPO5ZeY92ilt8cpZXGIPDBiB6AwBDk=; b=e3wAPk2d 1ulOZhgEzNOmfyC5GhKAwwoL1SkxpdioV5Dj89lqEAz/iVgvvYldA8MX774YRstn xo+qjAXUbEOEzam4vnYugxksDziD+6Edd6bkSXgSnyF5FaBlHvbnW+6c0008sAkg tnMNTBOLlRdpTIATDjF2MFzOL6wWWtBoVySFUMnhd1Zovum3tjSJqlmauma6z2B7 56DkEcqYjZwo94jKBcFTCIk2OqluGQOATzgfAQVnjj3M+3oylQSQphpwMU4REDOc zFHoRlaI/UsLJSVdCK/MyI3HWxOuvENZC3zsjxDxoZCzXqYwllan+ftjdyLeUMYe Txlsuvkls7hk2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=wayncnA+h39jYfPO5ZeY92ilt8cpZ XGIPDBiB6AwBDk=; b=JAmwbkWyiSzYwlV2E1rvMNoRJLzAA3d1751AQeAxcmn2B JJmnvMcOH2r8we5xUksi7u8KqqasLBdKmaR6MYaWukwiPyCA6Iu2dILX6u4WT1+6 ENLLbwLtD+e6GshqlrnzcL4F2rw9Ly4O5rv6ykeJxuUgSv1C8oMEL0StpVTCV24X q73rNeLSyTwIMyeoz3FuGjJShGC+BBYjoo93lg5rc8Ls0qrsn/G9X5nraFw7tU7N lf0YNcTO8SGA6XmZKPvY2LaiCDUEQdNi7/EGkj9zAHb+SGRL9IN7/2X4IQEeyHsS HoASmfEvHpsnDV9nbRoU1J3LnA6a0T+o6UXxmMRTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegtddgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugesthdtredttd dtvdenucfhrhhomheptehnughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghr rgiivghlrdguvgeqnecuffhomhgrihhnpehpohhsthhgrhdrvghsnecukfhppeeijedrud eitddrvddujedrvdehtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 392E33060F09 for ; Thu, 19 Mar 2020 18:44:51 -0400 (EDT) Date: Thu, 19 Mar 2020 15:44:49 -0700 From: Andres Freund To: pgsql-hackers@postgresql.org Subject: Why does [auto-]vacuum delay not report a wait event? Message-ID: <20200319224449.pbjrivflbf4x76tj@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, I was looking at [1], wanting to suggest a query to monitor what autovacuum is mostly waiting on. Partially to figure out whether it's mostly autovacuum cost limiting. But uh, unfortunately the vacuum delay code just sleeps without setting a wait event: void vacuum_delay_point(void) { ... /* Nap if appropriate */ if (msec > 0) { if (msec > VacuumCostDelay * 4) msec = VacuumCostDelay * 4; pg_usleep((long) (msec * 1000)); Seems like it should instead use a new wait event in the PG_WAIT_TIMEOUT class? Given how frequently we run into trouble with [auto]vacuum throttling being a problem, and there not being any way to monitor that currently, that seems like it'd be a significant improvement, given the effort? It'd probably also be helpful to report the total time [auto]vacuum spent being delayed for vacuum verbose/autovacuum logging, but imo that'd be a parallel feature to a wait event, not a replacement. Greetings, Andres Freund [1] https://postgr.es/m/CAE39h22zPLrkH17GrkDgAYL3kbjvySYD1io%2BrtnAUFnaJJVS4g%40mail.gmail.com