Обсуждение: Fix documentation for max_wal_size and min_wal_size
Hi,
The documentation [1] says max_wal_size and min_wal_size defaults are 1GB and 80 MB respectively. However, these are configured based on the wal_segment_size and documentation is not clear about it. Attached a patch to fix the documentation.
Thanks,
Sirisha
Вложения
At Thu, 13 Apr 2023 12:01:04 -0700, sirisha chamarthi <sirichamarthi22@gmail.com> wrote in > The documentation [1] says max_wal_size and min_wal_size defaults are 1GB > and 80 MB respectively. However, these are configured based on the > wal_segment_size and documentation is not clear about it. Attached a patch > to fix the documentation. > > [1] https://www.postgresql.org/docs/devel/runtime-config-wal.html Good catch! Now wal_segment_size is easily changed. - The default is 1 GB. + The default value is configured to maximum of 64 times the <varname>wal_segment_size</varname> or 1 GB. - The default is 80 MB. + The default value is configured to maximum of 5 times the <varname>wal_segment_size</varname> or 80 MB. However, I believe that most users don't change the WAL segment size, so the primary information is that the default sizes are 1GB and 80MB. So, I personally think it should be written like this: "The default size is 80MB. However, if you have changed the WAL segment size from the default of 16MB, it will be five times the segment size.", but I'm not sure what the others think about this.. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Hi,
On Fri, Apr 14, 2023 at 1:01 AM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote:
At Thu, 13 Apr 2023 12:01:04 -0700, sirisha chamarthi <sirichamarthi22@gmail.com> wrote in
> The documentation [1] says max_wal_size and min_wal_size defaults are 1GB
> and 80 MB respectively. However, these are configured based on the
> wal_segment_size and documentation is not clear about it. Attached a patch
> to fix the documentation.
>
> [1] https://www.postgresql.org/docs/devel/runtime-config-wal.html
Good catch! Now wal_segment_size is easily changed.
- The default is 1 GB.
+ The default value is configured to maximum of 64 times the <varname>wal_segment_size</varname> or 1 GB.
- The default is 80 MB.
+ The default value is configured to maximum of 5 times the <varname>wal_segment_size</varname> or 80 MB.
However, I believe that most users don't change the WAL segment size,
so the primary information is that the default sizes are 1GB and 80MB.
So, I personally think it should be written like this: "The default
size is 80MB. However, if you have changed the WAL segment size from
the default of 16MB, it will be five times the segment size.", but I'm
not sure what the others think about this..
This looks good to me.
Thanks,
Sirisha
On Mon, Apr 17, 2023 at 07:57:58PM -0700, sirisha chamarthi wrote: > On Fri, Apr 14, 2023 at 1:01 AM Kyotaro Horiguchi <horikyota.ntt@gmail.com> > wrote: >> So, I personally think it should be written like this: "The default >> size is 80MB. However, if you have changed the WAL segment size from >> the default of 16MB, it will be five times the segment size.", but I'm >> not sure what the others think about this.. Yes, I was under the impression that this should mention 16MB, but I'd also add a note about initdb when a non-default value is specified for the segment size. -- Michael
Вложения
Hi
On Mon, Apr 17, 2023 at 9:38 PM Michael Paquier <michael@paquier.xyz> wrote:
On Mon, Apr 17, 2023 at 07:57:58PM -0700, sirisha chamarthi wrote:
> On Fri, Apr 14, 2023 at 1:01 AM Kyotaro Horiguchi <horikyota.ntt@gmail.com>
> wrote:
>> So, I personally think it should be written like this: "The default
>> size is 80MB. However, if you have changed the WAL segment size from
>> the default of 16MB, it will be five times the segment size.", but I'm
>> not sure what the others think about this..
Yes, I was under the impression that this should mention 16MB, but
I'd also add a note about initdb when a non-default value is specified
for the segment size.
How about the text below?
"The default size is 80MB. However, if you have changed the WAL segment size
from the default of 16MB with the initdb option --wal-segsize, it will be five times the segment size."
On Tue, Apr 18, 2023 at 01:46:21AM -0700, sirisha chamarthi wrote: > "The default size is 80MB. However, if you have changed the WAL segment size > from the default of 16MB with the initdb option --wal-segsize, it will be > five times the segment size." Yes, I think that something close to that would be OK. Do others have any comments or extra ideas to offer? -- Michael
Вложения
On 2023/04/22 17:39, Michael Paquier wrote: > On Tue, Apr 18, 2023 at 01:46:21AM -0700, sirisha chamarthi wrote: >> "The default size is 80MB. However, if you have changed the WAL segment size >> from the default of 16MB with the initdb option --wal-segsize, it will be >> five times the segment size." > > Yes, I think that something close to that would be OK. Do others have > any comments or extra ideas to offer? If the WAL segment size is changed from the default value of 16MB during initdb, the value of min_wal_size in postgresql.conf is set to five times the new segment size by initdb. However, pg_settings.boot_val (the value of min_wal_size used when the parameter is not otherwise set) is still 80MB. So if pg_settings.boot_val should be documented as the default value, the current description seems OK. Or we can clarify that the default value of min_wal_size is 80MB, but when initdb is run with a non-default segment size, the value in postgresql.conf is changed to five times the new segment size? This will help users better understand the behavior of the setting and how it is affected by changes made during initdb. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
At Sat, 22 Apr 2023 18:52:27 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in > If the WAL segment size is changed from the default value of 16MB > during initdb, > the value of min_wal_size in postgresql.conf is set to five times the > new segment > size by initdb. However, pg_settings.boot_val (the value of > min_wal_size used > when the parameter is not otherwise set) is still 80MB. So if > pg_settings.boot_val > should be documented as the default value, the current description > seems OK. Hmm, things are a bit more complex than I initially thought. The value is actually set in the configuration file, but thelines are added by initdb. The documentation states the following. https://www.postgresql.org/docs/devel/view-pg-settings.html > boot_val text > Parameter value assumed at server startup if the parameter is not > otherwise set So, the description is accurate as it stands. If I remove the lines, they will revert to the default values. > Or we can clarify that the default value of min_wal_size is 80MB, but > when initdb > is run with a non-default segment size, the value in postgresql.conf > is changed > to five times the new segment size? This will help users better > understand > the behavior of the setting and how it is affected by changes made > during initdb. So, to clarify the situation, I would phrase it like this: The default size is 80MB. Note that if you have changed the WAL segment size from the default of 16MB with the initdb option --wal-segsize, the tool should have added the settings with the values equal to five times the specified segment size to the configuration file. It might be a bit wordy, though.. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
At Mon, 24 Apr 2023 10:57:56 +0900 (JST), Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote in > So, to clarify the situation, I would phrase it like this: > > The default size is 80MB. Note that if you have changed the WAL > segment size from the default of 16MB with the initdb option > --wal-segsize, the tool should have added the settings with the values > equal to five times the specified segment size to the configuration > file. > > It might be a bit wordy, though.. Or would the following work? The default size is 80MB. Note that initdb may have added the setting for this value if you have specified the WAL segment size when running the tool. regards. -- Kyotaro Horiguchi NTT Open Source Software Center