Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXy88-0002OV-NE for pgsql-admin@arkaria.postgresql.org; Sat, 26 Mar 2022 04:34:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXy85-0000JB-Hp for pgsql-admin@arkaria.postgresql.org; Sat, 26 Mar 2022 04:34:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXy85-0000Im-3V for pgsql-admin@lists.postgresql.org; Sat, 26 Mar 2022 04:34:21 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nXy81-0001jJ-Me for pgsql-admin@postgresql.org; Sat, 26 Mar 2022 04:34:20 +0000 Received: by mail-ej1-x632.google.com with SMTP id r13so18875179ejd.5 for ; Fri, 25 Mar 2022 21:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=DKYVV0Cj6r7L4DpKo5zZcamm1A3bMxBJzOHN8nDRHi8=; b=faRWVlPMV522aqolpc9FTZCEPOfufQSbM9y69cWZvN+AUff148TeyT+4zInbFAL4om +sATAq55NiMjmtqXpWJpbMFLJrRJ0PDWB4H2sc/k4BQYkx2kWQ0MqqZ9RDoeU+6Y9zlM cTct/sbXFW9uDnOA7zrypWESUpRfqi3/4q6ALOb0yD9Lx5xU0gbMgVL8J5z2/7z6l/bt CjRlwcnIl6kK6ITwW3HTshq6cP3I2hYbnGgpCYbAqiez7SX1/4hVo7wXYlmFxKVJtMS0 2vC6J2vLNqG2JiMIUKsYvqUpbPzcf/yzdtUaO5sX4US0ujkZ6JcOXxlxq/OHGiHEH4+j 21GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DKYVV0Cj6r7L4DpKo5zZcamm1A3bMxBJzOHN8nDRHi8=; b=kmekeEP4TAIfnN5Yvm3nOMHPHvYFJaKNUlz2HvaY3G0J4i3V+vQuevCjjFnEP6F/y0 KHhPn4QWi8W3Wb0mJpIkguI2VuRI+vWgvh+AJXOD6lh8mP49WA2AA3AEobSGfx94j0HJ MMMpfJ5e3H/Q6AsFDiwEif0FhrXlwAqFBZYHuqP1OM6qIfBPTqA5SABAlzySnx1cjFFe kS0hCH+1wJ9bIGiYZ0tCjO+jRiF56wAySDCQk0SPcCsPSzPb5uxmdIobNbvuDGMAjryp u/9TGtBq9V5z632xfIcKZGOwdC9O+uqJ51oRoJU/FcqmI+6T7KUso6PNvzQAdtn090cE kaDw== X-Gm-Message-State: AOAM531Qlvuv+nVqniQKS+r1/goFCI+lUmEdWtb8V50xRnaVv9+BEhsw LfMPagUgR9G2bnxzPu1W1B6ilBkHQgNoZg== X-Google-Smtp-Source: ABdhPJzPN3O1t9V5WQnyO4N+OJLUriiDxCj0XmaB9WuLW1uxXrflqW3gnT6dnUw1SenKtJ1tvFZUOg== X-Received: by 2002:a17:906:2408:b0:6e0:dc2a:3394 with SMTP id z8-20020a170906240800b006e0dc2a3394mr355007eja.181.1648269255729; Fri, 25 Mar 2022 21:34:15 -0700 (PDT) Received: from localhost.localdomain (178-190-183-69.adsl.highway.telekom.at. [178.190.183.69]) by smtp.gmail.com with ESMTPSA id f2-20020a170906738200b006df69629a3dsm3137047ejl.28.2022.03.25.21.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 21:34:15 -0700 (PDT) Message-ID: <965a52fe849ec6e5759d349b4063b5077353f24b.camel@cybertec.at> Subject: Re: Avoid Wraparound Failures From: Laurenz Albe To: Loles , pgsql-admin@postgresql.org Date: Sat, 26 Mar 2022 05:34:14 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-3.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2022-03-25 at 23:16 +0100, Loles wrote: > Suppose the databases on my instance are near to have a wraparound failure. > > (I think so, from what I see, but in the PostgreSQL log I haven't seen any warning about It yet). > > What do I have to do? > > vacuum freeze; > > better than, > > vacuum analyze; > > Or both? > > If the autovacuum_freeze configuration parameters have defaults values, should I modify any first? > > More I read of this topic, more confused I am. > > Please, I need simple and wise advice :) DON'T PANIC If what you see is the age of your oldest unfrozen rows approaching 200 million, everything is just normal. That's when anti-wraparound autovacuum *begins*. Normally, you have nothing to do, except perhaps make sure than autovacuum is fast enough (autovacuum_vacuum_cost_delay = 2). If you want to prevent that autovacuum run from happening while your system is busy (which normally also is no problem), you can trigger a manual VACUUM at a time of lower database activity. But make it a plain VACUUM, not a VACUUM (FREEZE) or (god forbid) VACUUM (FULL), and only VACUUM those tables that are large and approaching the threshold. And don't VACUUM them all at the same time. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com