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 1oT53G-0008Q4-53 for pgsql-admin@arkaria.postgresql.org; Tue, 30 Aug 2022 17:29:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oT53E-0003Q6-IZ for pgsql-admin@arkaria.postgresql.org; Tue, 30 Aug 2022 17:29:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT53E-0003PS-3O for pgsql-admin@lists.postgresql.org; Tue, 30 Aug 2022 17:29:24 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oT53B-0004B1-5a for pgsql-admin@lists.postgresql.org; Tue, 30 Aug 2022 17:29:23 +0000 Received: by mail-ej1-x636.google.com with SMTP id gb36so2739729ejc.10 for ; Tue, 30 Aug 2022 10:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc; bh=E0hXy5jqOYfX3LKtLaFbOD9/7Ddz+ttw03VsJ18U2nE=; b=1VbM4M1IL/Jw5lCA7Guhx2kfcYQC8ASdMXF1Hv4kpD3ShHnfTj5rNwiu67/gOL130X YariQjsqDLctnOWJKR8VZOKclg6ghhjw4bVkfFkQltFxnbPLZuz1+Ba3CNa2+J0RvWaQ Qxwl8ePPj0paNqQP3O/6GARjuCKANqIpT58BbJ+DtaeoNIEZT2uhyiiIp2A7doAPouva +1E1gNuIDzaZHrHk2V/9ulsqKtqQphvsmI+6YuBL3eVlmSW05ePrO1iVoaXJnmJHbR+2 QDMyGmGLhdejWsK/A+86jtJt8k8KzbM7HdKBtY5jrgASm5aDVIrQvDVXXJVfojr/t1kw Vi1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc; bh=E0hXy5jqOYfX3LKtLaFbOD9/7Ddz+ttw03VsJ18U2nE=; b=7gmd8nkrafg3fIVQqkGFI8xvEzmlxcrF/fB3WdbHJbARxCLPH7q9bhPbMKt//0CUq6 0T6n2NHKOe6Sr8UsOOL9Jfz7n3AmO0+czCi1M48Qf3LWzfpEajIg4DGkJ43QA7OaJZZY KrWlRcu+ngw50hjErfbNid5C1vvI/fBrpL2Iq4FxwvdQCd2o9+XQFoh/zDS5c3kTsJzV tONy1hUwpJ5kV91dlVR1Qlyo9yJ/mXE2EMAspwaRxQT+eFpa842NHdploGBahWna/25n DBvE/XxVoDGdn1H7tQUC85npJJSBr3zRt7kyecyNnn0PgEUaFhpZ4xicFYvlTMPG409T BNOg== X-Gm-Message-State: ACgBeo3l3jAXyYN/LxAWlAIcg0IRVd7dRRJ9dbxEIsa/N829M7+cXTwl oeU5nQZKBHwduvvpNqylwTFo1GrAK7vi0A== X-Google-Smtp-Source: AA6agR7YcgZZjxj6qRXiC+J4GJfSfK8ifkn7LSrqpfa5IFVqyM9AtApUAIDl7aNsYhAPnalRaXdCsA== X-Received: by 2002:a17:907:9710:b0:731:67b1:dc3b with SMTP id jg16-20020a170907971000b0073167b1dc3bmr18094922ejc.709.1661880559503; Tue, 30 Aug 2022 10:29:19 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:37bf:fab1:2000:e8d3:acd2]) by smtp.gmail.com with ESMTPSA id s14-20020a1709067b8e00b0073dc60271b2sm6184003ejo.32.2022.08.30.10.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 10:29:18 -0700 (PDT) Message-ID: Subject: Re: max_wal_size and wal_keep_size From: Laurenz Albe To: "James Pang (chaolpan)" , Jeff Janes Cc: "pgsql-admin@lists.postgresql.org" Date: Tue, 30 Aug 2022 19:29:17 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) 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 Tue, 2022-08-30 at 08:29 +0000, James Pang (chaolpan) wrote: > We want keep more wal to give more room for data replication, in case of some delay , > and need old wal data. So wan to set wal_keep_size , and want to increase > max_wal-size a lot to make max_wal_size > wal_keep_size (it may > 1TB). The two parameters are independent: - "max_wal_size" does *not* determine the maximum WAL size, but how much WAL can be produced before the next checkpoint is triggered. - "wal_keep_size" determines how much old WAL is kept around. Set "wal_keep_size" and leave "max_wal_size" unchanged. Or even better, use a replication slot. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com