mirror of
https://github.com/postgres/postgres.git
synced 2025-05-31 00:01:57 -04:00
Remove postmaster.c's check that NBuffers is at least twice MaxBackends.
With the addition of multiple autovacuum workers, our choices were to delete the check, document the interaction with autovacuum_max_workers, or complicate the check to try to hide that interaction. Since this restriction has never been adequate to ensure backends can't run out of pinnable buffers, it doesn't really have enough excuse to live to justify the second or third choices. Per discussion of a complaint from Andreas Kling (see also bug #3888). This commit also removes several documentation references to this restriction, but I'm not sure I got them all.
This commit is contained in:
parent
f4230d2937
commit
d9384a4b73
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.167 2008/03/05 16:59:10 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.168 2008/03/09 04:56:28 tgl Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime-config">
|
<chapter Id="runtime-config">
|
||||||
<title>Server Configuration</title>
|
<title>Server Configuration</title>
|
||||||
@ -736,8 +736,7 @@ SET ENABLE_SEQSCAN TO OFF;
|
|||||||
memory buffers. The default is typically 32 megabytes
|
memory buffers. The default is typically 32 megabytes
|
||||||
(<literal>32MB</>), but might be less if your kernel settings will
|
(<literal>32MB</>), but might be less if your kernel settings will
|
||||||
not support it (as determined during <application>initdb</>).
|
not support it (as determined during <application>initdb</>).
|
||||||
This setting must be at least 128 kilobytes and at least 16
|
This setting must be at least 128 kilobytes. (Non-default
|
||||||
kilobytes times <xref linkend="guc-max-connections">. (Non-default
|
|
||||||
values of <symbol>BLCKSZ</symbol> change the minimum.) However,
|
values of <symbol>BLCKSZ</symbol> change the minimum.) However,
|
||||||
settings significantly higher than the minimum are usually needed
|
settings significantly higher than the minimum are usually needed
|
||||||
for good performance. Several tens of megabytes are recommended
|
for good performance. Several tens of megabytes are recommended
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.552 2008/02/20 22:46:24 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.553 2008/03/09 04:56:28 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -688,16 +688,6 @@ PostmasterMain(int argc, char *argv[])
|
|||||||
/*
|
/*
|
||||||
* Check for invalid combinations of GUC settings.
|
* Check for invalid combinations of GUC settings.
|
||||||
*/
|
*/
|
||||||
if (NBuffers < 2 * MaxBackends || NBuffers < 16)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Do not accept -B so small that backends are likely to starve for
|
|
||||||
* lack of buffers. The specific choices here are somewhat arbitrary.
|
|
||||||
*/
|
|
||||||
write_stderr("%s: the number of buffers (-B) must be at least twice the number of allowed connections (-N) and at least 16\n", progname);
|
|
||||||
ExitPostmaster(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ReservedBackends >= MaxBackends)
|
if (ReservedBackends >= MaxBackends)
|
||||||
{
|
{
|
||||||
write_stderr("%s: superuser_reserved_connections must be less than max_connections\n", progname);
|
write_stderr("%s: superuser_reserved_connections must be less than max_connections\n", progname);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.433 2008/03/06 16:31:42 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.434 2008/03/09 04:56:28 tgl Exp $
|
||||||
*
|
*
|
||||||
*--------------------------------------------------------------------
|
*--------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1195,16 +1195,10 @@ static struct config_int ConfigureNamesInt[] =
|
|||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: There is some postprocessing done in PostmasterMain() to make
|
* Note: MaxBackends is limited to INT_MAX/4 because some places compute
|
||||||
* sure the buffers are at least twice the number of backends, so the
|
* 4*MaxBackends without any overflow check. This check is made in
|
||||||
* constraints here are partially unused. Similarly, the superuser
|
|
||||||
* reserved number is checked to ensure it is less than the max backends
|
|
||||||
* number.
|
|
||||||
*
|
|
||||||
* MaxBackends is limited to INT_MAX/4 because some places compute
|
|
||||||
* 4*MaxBackends without any overflow check. This check is made on
|
|
||||||
* assign_maxconnections, since MaxBackends is computed as MaxConnections
|
* assign_maxconnections, since MaxBackends is computed as MaxConnections
|
||||||
* + autovacuum_max_workers.
|
* plus autovacuum_max_workers.
|
||||||
*
|
*
|
||||||
* Likewise we have to limit NBuffers to INT_MAX/2.
|
* Likewise we have to limit NBuffers to INT_MAX/2.
|
||||||
*/
|
*/
|
||||||
|
@ -60,8 +60,7 @@
|
|||||||
#port = 5432 # (change requires restart)
|
#port = 5432 # (change requires restart)
|
||||||
#max_connections = 100 # (change requires restart)
|
#max_connections = 100 # (change requires restart)
|
||||||
# Note: Increasing max_connections costs ~400 bytes of shared memory per
|
# Note: Increasing max_connections costs ~400 bytes of shared memory per
|
||||||
# connection slot, plus lock space (see max_locks_per_transaction). You might
|
# connection slot, plus lock space (see max_locks_per_transaction).
|
||||||
# also need to raise shared_buffers to support more connections.
|
|
||||||
#superuser_reserved_connections = 3 # (change requires restart)
|
#superuser_reserved_connections = 3 # (change requires restart)
|
||||||
#unix_socket_directory = '' # (change requires restart)
|
#unix_socket_directory = '' # (change requires restart)
|
||||||
#unix_socket_group = '' # (change requires restart)
|
#unix_socket_group = '' # (change requires restart)
|
||||||
@ -104,7 +103,7 @@
|
|||||||
|
|
||||||
# - Memory -
|
# - Memory -
|
||||||
|
|
||||||
#shared_buffers = 32MB # min 128kB or max_connections*16kB
|
#shared_buffers = 32MB # min 128kB
|
||||||
# (change requires restart)
|
# (change requires restart)
|
||||||
#temp_buffers = 8MB # min 800kB
|
#temp_buffers = 8MB # min 800kB
|
||||||
#max_prepared_transactions = 5 # can be 0 or more
|
#max_prepared_transactions = 5 # can be 0 or more
|
||||||
|
Loading…
x
Reference in New Issue
Block a user