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 1jF3lH-0005d0-6l for pgsql-general@arkaria.postgresql.org; Thu, 19 Mar 2020 22:35:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jF3lE-0004Jz-9u for pgsql-general@arkaria.postgresql.org; Thu, 19 Mar 2020 22:35:32 +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 1jF3lE-0004Js-0M for pgsql-general@lists.postgresql.org; Thu, 19 Mar 2020 22:35:32 +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 1jF3l7-0004On-11 for pgsql-general@lists.postgresql.org; Thu, 19 Mar 2020 22:35:31 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 41D66885; Thu, 19 Mar 2020 18:35:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 19 Mar 2020 18:35:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=O9L1WcoMhNeHTGoxtPu7Tkbbd2+ M+8NhvJf99sNpvwI=; b=LLCxck9nwkCYdhCBkwCacqY67FYKzrOVKgf4pUop1MF D6br1Ps8m88LeQfrHRfWuUF3BR5heFgTMIA2IPKzC6866u67pqZPpkeXbmvmPjxq FHxIXYl9oKIoW5Mo3PdKieCldAtt5GPHGsqIp4G+EncwDMLlwp78Seb1IKb/7BRR k8IePGy8VBB3jT9+lqEESRMycFuCevvgNPkw2+sK9n1w/rJilXN6gG8Asj3Ey5d6 vIrHkCwvSl0wtFA6wn765TOe4gfQNhlVg22U0HavrQkRhcLYWmdV/p5OEyfUJabV +gQ0B2Uj3A5HF9hSB6h1XWG97l1e8WGKFadINQrDYTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=O9L1Wc oMhNeHTGoxtPu7Tkbbd2+M+8NhvJf99sNpvwI=; b=jeUiEmTc3GnFncxnksGse9 kXIiYgb9SxjazVcfm9h9De6mXMPvirgbnwWpijs+VFbrv+LQeXh7If7QvhTZwUSh 7qpJeTZuXlzgLCZh3iWTI8qnSTKc6QCUMVGZbdbzVD71lZve1DLzPpQ+VDCxEh+h s2DmjKKINeD3che0xwg732hZWuBiKPl7Dic41pNMKnx5lekut/TdQlXinK1LV0RT rIVS5uBehj0p88I0OQL9034mz99mORegHhlMtP0C3woiy5y/Caqk+PiPpy7ieIdo Igp59LjOmEp7Op5GA6Zmi+N+72akFNzwlaYialZdpGckb9Mb79zeqVFedBrTqbQw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudegtddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepie ejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv 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 56F26328005E; Thu, 19 Mar 2020 18:35:21 -0400 (EDT) Date: Thu, 19 Mar 2020 15:35:20 -0700 From: Andres Freund To: Justin King Cc: pgsql-general@lists.postgresql.org Subject: Re: PG12 autovac issues Message-ID: <20200319223520.2mnjt6l3yybgnd77@alap3.anarazel.de> References: <20200318011952.caitfhlslpq6zype@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-03-19 10:23:48 -0500, Justin King wrote: > > From a single stats snapshot we can't actually understand the actual xid > > consumption - is it actually the xid usage that triggers the vacuums? > > We have looked at this and the xid consumption averages around 1250 > xid/sec -- this is when we see the "aggressive" autovac kick off in > the logs. What I don't understand is why these xid's are being > consumed at this rate on the databases with no activity (postgres, > template1). The xid counter is global across all databases. > > What makes you think it is a problem that you have all these vacuums? If > > you actually update that much, and you have indexes, you're going want a > > lot of vacuums? > I actually don't think there's a problem with the vacuums (I was > mostly pointing out that they are very regular and not problematic). > The main problem I am having is that something is causing the > autovacuums to completely stop and require manual intervention to > resume -- and it seems to be when the "postgres" or "template1" > database hits the autovacuum_freeze_max_age. Did you look at pg_stat_activity for those autovacuums to see whether they're blocked on something? > > > What is interesting is that this happens with the 'postgres' and > > > 'template1' databases as well and there is absolutely no activity in > > > those databases. > > > > That's normal. They should be pretty darn quick in v12? > > Yes, a manual VACUUM FREEZE of either database takes less than 1 > second -- which is why it's perplexing that the autovac starts and > never seems to complete and prevents other autovacs from running. One big difference between a manual VACUUM and autovacuum is that with the default settings VACUUM is not throttled, but autovacuum is. What are your vacuum_cost_delay, autovacuum_vacuum_cost_delay, vacuum_cost_limit, autovacuum_vacuum_cost_limit, vacuum_cost_page_hit, vacuum_cost_page_miss set to? Greetings, Andres Freund