Обсуждение: The order of postgresql.conf parameters is potentially confusing. Very minor cosmetic bug or "niggle"!

Поиск
Список
Период
Сортировка

The order of postgresql.conf parameters is potentially confusing. Very minor cosmetic bug or "niggle"!

От
Pól Ua Laoínecháin
Дата:
OS: Linux (Fedora 34)
PostgreSQL from: source code
Versions affected: 12.7, 13,2 & 14 Beta3

Hi,

I used pgtune to configure my system and received the following
recommendations: (most have been snipped for brevity):

...
...
min_wal_size = 1GB
max_wal_size = 4GB
...
max_worker_processes = 2
max_parallel_workers_per_gather = 1
max_parallel_workers = 2
max_parallel_maintenance_workers = 1
...

Now, I was going through my postgresql.conf file in accordance with
the recommendations and was changing the min_wal_size and max_wal_size
parameters.

However, in the .conf, the max_wal_size comes *_before_* the
min_wal_size and I nearly inverted my changes - i.e. setting the min
recommendation to the max one and vice versa.

Hardly a major issue, but in my opinion, it is *_totally_* illogical
to have the max_wal_size on the line above the min_wal_size. I propose
that this should be changed!

Also, with the max....workers... parameters

The untouched .conf file is as follows:

#max_worker_processes = 8               # (change requires restart)
#max_parallel_maintenance_workers = 2   # taken from max_parallel_workers
#max_parallel_workers_per_gather = 2    # taken from max_parallel_workers
#parallel_leader_participation = on
#max_parallel_workers = 8               # maximum number of
max_worker_processes that
                                        # can be used in parallel operations


Now, max_worker_processes = 8 is fine, BUT, both the

max_parallel_maintenance_workers

and the

max_parallel_workers_per_gather

parameters depend on the max_parallel_workers parameter.

Surely then, the max_parallel_workers parameter should appear before
the two others which depend on it?


I realise that these are not show-stoppers but at least in the case of
the max_wal_ and min_wal_ size parameters, the inversion is a source
of cognitive dissonance which a simple swapping of their respective
positions would solve.


Should you require any further information, please don't hesitate to contact mej

Best regards,



Pól Ua Laoínecháin...



Re: The order of postgresql.conf parameters is potentially confusing. Very minor cosmetic bug or "niggle"!

От
"David G. Johnston"
Дата:
On Wed, Sep 1, 2021 at 9:11 AM Pól Ua Laoínecháin <linehanp@tcd.ie> wrote:
I used pgtune to configure my system and received the following
...
min_wal_size = 1GB
max_wal_size = 4GB
...
max_worker_processes = 2
max_parallel_workers_per_gather = 1
max_parallel_workers = 2
max_parallel_maintenance_workers = 1
[...]

Surely then, the max_parallel_workers parameter should appear before
the two others which depend on it?

I agree with this premise.
 
I realise that these are not show-stoppers but at least in the case of
the max_wal_ and min_wal_ size parameters, the inversion is a source
of cognitive dissonance which a simple swapping of their respective
positions would solve.


If one considers importance or utility when deciding upon the order then max coming before min is the correct order; it is surely more important to clamp the maximum than it is to ensure some minimum amount is present as a performance optimization.  A minor point, but the status quo is also alphabetical.

Apparently pgTune has its own way of determining order, which also isn't alphabetical and doesn't, at least for the workers, match the supplied logic.  As the program of lesser importance it should be changed to match what the server does, not vice-versa.  IOW, I agree that the mixup regarding max/min WAL is worthy of being avoided - but the change should be in pgTune, not postgresql.conf.

David J.

=?UTF-8?B?UMOzbCBVYSBMYW/DrW5lY2jDoWlu?= <linehanp@tcd.ie> writes:
> Hardly a major issue, but in my opinion, it is *_totally_* illogical
> to have the max_wal_size on the line above the min_wal_size. I propose
> that this should be changed!

It's probably that way on the basis of alphabetical order.

We very often have debates on whether documentation lists should be
strictly alphabetical or not.  Neither side has entirely won the
day, but I'm not sure the case for "min before max" is strong
enough to justify non-alphabetical here.

            regards, tom lane