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 1qsVK2-008JlK-Nl for pgsql-admin@arkaria.postgresql.org; Mon, 16 Oct 2023 21:40:22 +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 1qsVK0-004Xgm-PA for pgsql-admin@arkaria.postgresql.org; Mon, 16 Oct 2023 21:40:21 +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 1qsVK0-004XgX-C9 for pgsql-admin@lists.postgresql.org; Mon, 16 Oct 2023 21:40:21 +0000 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qsVJv-00148p-1o for pgsql-admin@postgresql.org; Mon, 16 Oct 2023 21:40:20 +0000 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9be1ee3dc86so446270966b.1 for ; Mon, 16 Oct 2023 14:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697492413; x=1698097213; darn=postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ba2WPRA3jY8k8O2QsTiwTrYbzHEX4cFmS2Scyd8wyKY=; b=TtUQ7qFHwas/u9zTA+28aIcryNZmwNMCDnLylqM8p1r/+rReyqg5BdQD/okpGH6mEy p6sLbZlgF/eF5+E+QThIagGanR6gMnwJvVUi1ItNu2ahPoDZzsXf17Ih7n8ipc7I2KHW K8MGL94i82specMd0UvqKey2OsbPK4vhyOiowCkoAA/W8A/NXd+yp/Y2G9Zb4rWK5Kjg MO3Va+wlmCeuELGR5GqI+Jjz1WBXLgtFfK9ABii6SC9ZvNyioAI+zEaUhf9jICybm+o6 wyNTxNmn9Rpy+xwHObXmxAZeXnvwMjQbP5tnKVF4ThyLxrauo11YMo64q3hsjv4+MNv9 ljug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697492413; x=1698097213; h=user-agent:in-reply-to:content-disposition:mime-version:references :subject:cc:to:from:date:sender:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ba2WPRA3jY8k8O2QsTiwTrYbzHEX4cFmS2Scyd8wyKY=; b=uxcAVcL+J1o/peS9I8plxc1NTMhptknN9P2TIZ/H/wvqP8EoefxUrM4payGc02GjN1 42EoyUJ85dZ5HcN26YCerwVB90JpgRj6LkW74eZvcpkhukUzsT714vc2tch5Rwv62ERi Zja2h1oqnGfi62OO8I69plhCyTAZ+6JRyo0SJdHSez0An3ZSvQbIPC5cQvMRCatcm+Bu 0K8Tj/KLZbbBoBlQHc4RbjmsFnbkM9dzH9O7LjgKnNsVPahutD1lSdPAAlkkSLkHV3MS ZcumnzLJmkzhdrT1YPrA7yfwIQs8wN+6iFTG2BvaUJEtxSEzkBABtIOjiUDUzk3s/zYO KpbA== X-Gm-Message-State: AOJu0YyWrmKh2HQ3UOmfZijfY/dPjvqbZ5R35jNKnu1i+dNnoyEI7LpW KMsjMxT3iBDSXuH5HoVwbSQ= X-Google-Smtp-Source: AGHT+IFw+9LhGP8jiLo6REDbmVRFtqVUETJH0bi2ZGPCSwtHY2YirK7v1V3iGemkig/7swj/ktxxLQ== X-Received: by 2002:a17:907:1b29:b0:9be:36c2:162 with SMTP id mp41-20020a1709071b2900b009be36c20162mr235112ejc.31.1697492413461; Mon, 16 Oct 2023 14:40:13 -0700 (PDT) Received: from lightning.caipicrew.dd-dns.de ([2001:a61:34cf:1001:f11c:3b32:31b7:711]) by smtp.gmail.com with ESMTPSA id e26-20020a170906845a00b00997cce73cc7sm22409ejy.29.2023.10.16.14.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 14:40:13 -0700 (PDT) Message-ID: <652dadbd.170a0220.1d68.00f9@mx.google.com> X-Google-Original-Message-ID: <20231016214012.GQ27104@caipicrew.dd-dns.de;lightning.caipicrew.dd-dns.de> Sender: Michael Banck Received: from mbanck by lightning.caipicrew.dd-dns.de with local (Exim 4.92) (envelope-from ) id 1qsVJs-0002Xa-Hi; Mon, 16 Oct 2023 23:40:12 +0200 Date: Mon, 16 Oct 2023 23:40:12 +0200 From: Michael Banck To: Murthy Nunna Cc: "pgsql-admin@postgresql.org" Subject: Re: Auto Vacuum Question References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Mon, Oct 16, 2023 at 08:46:48PM +0000, Murthy Nunna wrote: > It looks like the max value of autovacuum_freeze_max_age is 2 billion. > I am wondering why anybody wants to change this setting to a lower number? At a transaction age a bit above 2 billion, Postgres will stop accepting connections and one needs to vacuum manually, usually resulting in a long downtime. So one needs some (or rather a lot of) daylight between the time autovacuum decides to freeze a table and Postgres shutting down - it could be that autovacuum is held back by long-running transactions or unused replication slots or something. I would consider autovacuum_freeze_max_age up to 1 billion mostly safe (depending on the workload) and values up to 1.6 billion acceptable if good monitoring is in place and everybody knows what is going on. The other reason why want might not want to set autovacuum_freeze_max_age so high is that the pg_xact and pg_commit_ts sizes are proportional to autovacuum_freeze_max_age and take up more space if autovacuum_freeze_max_age is higher, which might be problematic if there is not a lot of storage present. Michael