Skip to content

Commit f63cbcc

Browse files
committed
Mop-up for previous change to determine default shared_buffers and
max_connections at initdb time. Get rid of DEF_NBUFFERS and DEF_MAXBACKENDS macros, which aren't doing anything useful anymore, and put more likely defaults into postgresql.conf.sample.
1 parent 9116f6c commit f63cbcc

File tree

7 files changed

+17
-22
lines changed

7 files changed

+17
-22
lines changed

src/backend/port/ipc_test.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/backend/port/ipc_test.c,v 1.9 2003/08/04 02:40:02 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/backend/port/ipc_test.c,v 1.10 2003/08/26 15:38:24 tgl Exp $
2525
*
2626
*-------------------------------------------------------------------------
2727
*/
@@ -50,8 +50,8 @@ const bool ExecBackend = false;
5050

5151
bool IsUnderPostmaster = false;
5252

53-
int MaxBackends = DEF_MAXBACKENDS;
54-
int NBuffers = DEF_NBUFFERS;
53+
int MaxBackends = 32;
54+
int NBuffers = 64;
5555

5656
#ifndef assert_enabled
5757
bool assert_enabled = true;

src/backend/tcop/postgres.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.360 2003/08/13 16:16:23 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.361 2003/08/26 15:38:24 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1978,7 +1978,7 @@ usage(char *progname)
19781978
#ifdef USE_ASSERT_CHECKING
19791979
printf(" -A 1|0 enable/disable run-time assert checking\n");
19801980
#endif
1981-
printf(" -B NBUFFERS number of shared buffers (default %d)\n", DEF_NBUFFERS);
1981+
printf(" -B NBUFFERS number of shared buffers\n");
19821982
printf(" -c NAME=VALUE set run-time parameter\n");
19831983
printf(" -d 0-5 debugging level (0 is off)\n");
19841984
printf(" -D DATADIR database directory\n");
@@ -2651,7 +2651,7 @@ PostgresMain(int argc, char *argv[], const char *username)
26512651
if (!IsUnderPostmaster)
26522652
{
26532653
puts("\nPOSTGRES backend interactive interface ");
2654-
puts("$Revision: 1.360 $ $Date: 2003/08/13 16:16:23 $\n");
2654+
puts("$Revision: 1.361 $ $Date: 2003/08/26 15:38:24 $\n");
26552655
}
26562656

26572657
/*

src/backend/utils/init/globals.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.74 2003/08/04 02:40:06 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.75 2003/08/26 15:38:25 tgl Exp $
1212
*
1313
* NOTES
1414
* Globals used all over the place should be declared here and not
@@ -70,4 +70,4 @@ bool enableFsync = true;
7070
bool allowSystemTableMods = false;
7171
int SortMem = 1024;
7272
int VacuumMem = 8192;
73-
int NBuffers = DEF_NBUFFERS;
73+
int NBuffers = 1000;

src/backend/utils/misc/guc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.150 2003/08/17 22:19:15 tgl Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.151 2003/08/26 15:38:25 tgl Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -944,7 +944,7 @@ static struct config_int ConfigureNamesInt[] =
944944
NULL
945945
},
946946
&MaxBackends,
947-
DEF_MAXBACKENDS, 1, INT_MAX, NULL, NULL
947+
100, 1, INT_MAX, NULL, NULL
948948
},
949949

950950
{
@@ -962,7 +962,7 @@ static struct config_int ConfigureNamesInt[] =
962962
NULL
963963
},
964964
&NBuffers,
965-
DEF_NBUFFERS, 16, INT_MAX, NULL, NULL
965+
1000, 16, INT_MAX, NULL, NULL
966966
},
967967

968968
{

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# - Connection Settings -
2929

3030
#tcpip_socket = false
31-
#max_connections = 32
31+
#max_connections = 100
3232
# note: increasing max_connections costs about 500 bytes of shared
3333
# memory per connection slot, in addition to costs from shared_buffers
3434
# and max_locks_per_transaction.
@@ -55,7 +55,7 @@
5555

5656
# - Memory -
5757

58-
#shared_buffers = 64 # min 16, at least max_connections*2, 8KB each
58+
#shared_buffers = 1000 # min 16, at least max_connections*2, 8KB each
5959
#sort_mem = 1024 # min 64, size in KB
6060
#vacuum_mem = 8192 # min 1024, size in KB
6161

src/bin/initdb/initdb.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
2828
# Portions Copyright (c) 1994, Regents of the University of California
2929
#
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.199 2003/07/27 04:35:53 momjian Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.200 2003/08/26 15:38:25 tgl Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -586,8 +586,8 @@ $ECHO_N "creating configuration files... "$ECHO_C
586586

587587
cp "$PG_HBA_SAMPLE" "$PGDATA"/pg_hba.conf || exit_nicely
588588
cp "$PG_IDENT_SAMPLE" "$PGDATA"/pg_ident.conf || exit_nicely
589-
sed -e "s/^#shared_buffers = 64/shared_buffers = $nbuffers/" \
590-
-e "s/^#max_connections = 32/max_connections = $nconns/" \
589+
sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
590+
-e "s/^#max_connections = 100/max_connections = $nconns/" \
591591
-e "s/^#lc_messages = 'C'/lc_messages = '`pg_getlocale MESSAGES`'/" \
592592
-e "s/^#lc_monetary = 'C'/lc_monetary = '`pg_getlocale MONETARY`'/" \
593593
-e "s/^#lc_numeric = 'C'/lc_numeric = '`pg_getlocale NUMERIC`'/" \

src/include/miscadmin.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
1313
* Portions Copyright (c) 1994, Regents of the University of California
1414
*
15-
* $Id: miscadmin.h,v 1.132 2003/08/04 04:03:10 tgl Exp $
15+
* $Id: miscadmin.h,v 1.133 2003/08/26 15:38:25 tgl Exp $
1616
*
1717
* NOTES
1818
* some of the information in this file should be moved to
@@ -191,17 +191,12 @@ extern int VacuumMem;
191191
* A few postmaster startup options are exported here so the
192192
* configuration file processor can access them.
193193
*/
194-
195194
extern bool NetServer;
196195
extern bool EnableSSL;
197196
extern bool SilentMode;
198197
extern int MaxBackends;
199-
200-
#define DEF_MAXBACKENDS 32
201198
extern int ReservedBackends;
202199
extern DLLIMPORT int NBuffers;
203-
204-
#define DEF_NBUFFERS (DEF_MAXBACKENDS > 8 ? DEF_MAXBACKENDS * 2 : 16)
205200
extern int PostPortNumber;
206201
extern int Unix_socket_permissions;
207202
extern char *Unix_socket_group;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy