BUG #3888: postmaster: misleading error message for illegal -B values

Started by Marti Raudseppover 18 years ago3 messagesbugs
Jump to latest
#1Marti Raudsepp
marti@juffo.org

The following bug has been logged online:

Bug reference: 3888
Logged by: Marti Raudsepp
Email address: marti@juffo.org
PostgreSQL version: 8.3RC1
Operating system: Linux AMD64
Description: postmaster: misleading error message for illegal -B
values
Details:

When launching postmaster with a small -B (number of buffers) value, it
reports the following error:
"postmaster: the number of buffers (-B) must be at least twice the number of
allowed connections (-N) and at least 16"

However, as of PostgreSQL 8.3, postmaster requires that the number of
buffers is at least (max_connections*2 + 6)

To reproduce the bug:
# sudo -u postgres postmaster -D $PGDATA -N 8 -B 16
postmaster: the number of buffers (-B) must be at least twice the number of
allowed connections (-N) and at least 16
# sudo -u postgres postmaster -D $PGDATA -N 8 -B 21
postmaster: the number of buffers (-B) must be at least twice the number of
allowed connections (-N) and at least 16

Specifying -B 22 works as expected.

#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Marti Raudsepp (#1)
Re: BUG #3888: postmaster: misleading error message for illegal -B values

Marti Raudsepp wrote:

Bug reference: 3888
Logged by: Marti Raudsepp
Email address: marti@juffo.org
PostgreSQL version: 8.3RC1
Operating system: Linux AMD64
Description: postmaster: misleading error message for illegal -B
values
Details:

When launching postmaster with a small -B (number of buffers) value, it
reports the following error:
"postmaster: the number of buffers (-B) must be at least twice the number of
allowed connections (-N) and at least 16"

However, as of PostgreSQL 8.3, postmaster requires that the number of
buffers is at least (max_connections*2 + 6)

Hmm. The minimum is actually (max_connections + max_autovacuum_workers)
* 2. The default max_autovacuum_workers is 3, which is where that 6
(2*3) comes from.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Heikki Linnakangas (#2)
Re: BUG #3888: postmaster: misleading error message for illegal -B values

"Heikki Linnakangas" <heikki@enterprisedb.com> writes:

Marti Raudsepp wrote:

However, as of PostgreSQL 8.3, postmaster requires that the number of
buffers is at least (max_connections*2 + 6)

Hmm. The minimum is actually (max_connections + max_autovacuum_workers)
* 2. The default max_autovacuum_workers is 3, which is where that 6
(2*3) comes from.

It's sort of irrelevant IMHO, as any useful setting is orders of
magnitude larger than that anyway. If we were to touch this code it
should be to increase the minimum setting, not to fine-tune the message
text ...

regards, tom lane