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 1na3v7-0002vN-PH for pgsql-admin@arkaria.postgresql.org; Thu, 31 Mar 2022 23:09:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1na3v5-0004R0-KJ for pgsql-admin@arkaria.postgresql.org; Thu, 31 Mar 2022 23:09:35 +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 1na3v5-0004Qq-3U for pgsql-admin@lists.postgresql.org; Thu, 31 Mar 2022 23:09:35 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1na3uw-0008MQ-GZ for pgsql-admin@lists.postgresql.org; Thu, 31 Mar 2022 23:09:33 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id kk12so741085qvb.13 for ; Thu, 31 Mar 2022 16:09:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=7LkpiYVNSSpyYwdz9PHvGXqYRVNOfoEjtvksRnmGkiM=; b=R6igv8938aozDjI8fFi3EgdZATdj0NBZFUpkvYMmpli83ghHyMXbAJiNWdd2/56sI3 5pos8I7Okl6lx8GA88TwsgquczKKk25+n6ImEWskW0vkKNsjvdTGy/ykVnBYe53Ecy1H +dvGthb4El/WZ9S6u9T/pHwqnziKWEJ/u3l8BZwVJjicQF4OcQRqGa7ccd++Bu35Ct5U ipt22ddcR99sGBQtEKgRDbBLL9VynQr20021yoY7me4gOEi+6NeE9npFDMzhunpsre1Y xssIoVVyOGH9MDHvgPakGOo8/I82Fad2QUmvkSi7s4OLuF2gMHnS3jaASET6QxNsru4u 2OJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=7LkpiYVNSSpyYwdz9PHvGXqYRVNOfoEjtvksRnmGkiM=; b=bCgbeRe1xcKQFL/Zavv7rlKfDzfYSZeEALkpnxxwRMZltane5uW/VpLQ5oVqmIflNd s6MeNj93cMEYRCBb60gd21onhph6kB9FdhqM1/uBVhrZgOrTV7qcbkg64/nV3rpgziUR cN9sCV6IIbYPvWzC1zj6m7L5PRT6gCturSWWJUi/elHBlvkLRBlvMZsUPmwoMtPrMG1p t2OkhOmLzQnweUdkxJL8EA11lZfybEQb5cI+m4jWRW9ZbWwahzqpEkDXxJyjNI7SrMaC w9uoocDH7ENhfPiVZsfFq2Bfot3lVsQh7njUZuhZOT/9GyInEkZtOfu1AtDwmOtThjvl x4Ow== X-Gm-Message-State: AOAM531DfE7/UwDHkSKGtAPiJfBUb/JHKFoH9B2BMNtSMxJv9DPjSBJf 9qf7r7BuGGISccn8/cgzVxAlfEEQu6sE+A== X-Google-Smtp-Source: ABdhPJyGI8JvCSUxXvsay7mZ0zd4qFIsp2gVMrBy/vyxTAS/lLJ1LvpYuIODAWaq/fZux6B8Zljvsw== X-Received: by 2002:a05:6214:1d0e:b0:441:4e6c:c7f with SMTP id e14-20020a0562141d0e00b004414e6c0c7fmr6325956qvd.78.1648768164978; Thu, 31 Mar 2022 16:09:24 -0700 (PDT) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id bi24-20020a05620a319800b00680e41e20c2sm406447qkb.96.2022.03.31.16.09.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 16:09:24 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------mUywwr8g1ZD3cE0EGPb6BZ0R" Message-ID: <1dd2bcec-c145-b65b-21b8-0e391b05e8e4@gmail.com> Date: Thu, 31 Mar 2022 19:09:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: WAL & ZFS Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: <43EEBE2E-4C7F-4F35-99BF-4DA8B5D3828A@crazybean.net> <35c98a4b-f7a1-a896-4484-582bbaaffb5b@jakobs.com> From: Mladen Gogala In-Reply-To: <35c98a4b-f7a1-a896-4484-582bbaaffb5b@jakobs.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------mUywwr8g1ZD3cE0EGPb6BZ0R Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/31/22 18:47, Holger Jakobs wrote: > The WAL is a journal itself and doesn't need another journal for > safety. Therefore, a common recommendation is using ext2 (which has no > journal) for the WAL partition. > > Is this correct? > > Am 31.03.22 um 23:32 schrieb Rui DeSousa: >> I would recommend a separate pg_wal filesystem with the record size >> to match the WAL page size; in my case 16k.  I have keep the default >> record size at 128k for the data volume and that configuration has >> worked well for supporting large DSS while using 16k data blocks. >> >>> On Mar 30, 2022, at 5:32 PM, Scott Ribe >>> wrote: >>> >>> I've read all the info I could find re running PG on ZFS: turn off >>> full page writes, turn on lz4, tweak recordsize so as to take >>> advantage of compression, etc. One thing I haven't seen is whether a >>> separate volume for WAL would benefit from a larger recordsize. Or >>> any other tweaks??? >>> >>> -- >>> Scott Ribe >>> scott_ribe@elevated-dev.com >>> https://www.linkedin.com/in/scottribe/ >>> >>> >>> >>> >>> >> >> Journallng file systems journal file operations like open, close, create, extend, rename or delete, not file block operations. File blocks are not protected by file system journalling, just the inodes. The file system journal prevents you from losing files in case of sudden machine crash, like when the machine loses power. It has nothing to do with the block change journaling, which is the role of WAL files. WAL files record the changes to database blocks. With ext2, it would be possible to lose a WAL log in case of a sudden crash and that might prevent the cluster recovery. File system journaling has nothing to do with WAL logs. I would strongly advise against using ext2 for WAL logs. Regards -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------mUywwr8g1ZD3cE0EGPb6BZ0R Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 3/31/22 18:47, Holger Jakobs wrote:
The WAL is a journal itself and doesn't need another journal for safety. Therefore, a common recommendation is using ext2 (which has no journal) for the WAL partition.

Is this correct?

Am 31.03.22 um 23:32 schrieb Rui DeSousa:
I would recommend a separate pg_wal filesystem with the record size to match the WAL page size; in my case 16k.  I have keep the default record size at 128k for the data volume and that configuration has worked well for supporting large DSS while using 16k data blocks.

On Mar 30, 2022, at 5:32 PM, Scott Ribe <scott_ribe@elevated-dev.com> wrote:

I've read all the info I could find re running PG on ZFS: turn off full page writes, turn on lz4, tweak recordsize so as to take advantage of compression, etc. One thing I haven't seen is whether a separate volume for WAL would benefit from a larger recordsize. Or any other tweaks???

--
Scott Ribe
scott_ribe@elevated-dev.com
https://www.linkedin.com/in/scottribe/







Journallng file systems journal file operations like open, close, create, extend, rename or delete, not file block operations. File blocks are not protected by file system journalling, just the inodes. The file system journal prevents you from losing files in case of sudden machine crash, like when the machine loses power. It has nothing to do with the block change journaling, which is the role of WAL files. WAL files record the changes to database blocks. With ext2, it would be possible to lose a WAL log in case of a sudden crash and that might prevent the cluster recovery. File system journaling has nothing to do with WAL logs. I would strongly advise against using ext2 for WAL logs.

Regards

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------mUywwr8g1ZD3cE0EGPb6BZ0R--