Mop-up for previous change to determine default shared_buffers and
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2003 15:38:25 +0000 (15:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 Aug 2003 15:38:25 +0000 (15:38 +0000)
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.

src/backend/port/ipc_test.c
src/backend/tcop/postgres.c
src/backend/utils/init/globals.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/bin/initdb/initdb.sh
src/include/miscadmin.h

index 9fafac6e93a5968063f59dac0ba55d98c1e7be07..acee235ad0f374d1ee25ff8176ddbdadc8d6b44b 100644 (file)
@@ -50,8 +50,8 @@ const bool    ExecBackend = false;
 
 bool           IsUnderPostmaster = false;
 
-int                    MaxBackends = DEF_MAXBACKENDS;
-int                    NBuffers = DEF_NBUFFERS;
+int                    MaxBackends = 32;
+int                    NBuffers = 64;
 
 #ifndef assert_enabled
 bool           assert_enabled = true;
index 5be5e36848a2e4b2dd9e7527da0818010ad990ac..deb227beb51797e00895f6d97f07f75ea62db87b 100644 (file)
@@ -1978,7 +1978,7 @@ usage(char *progname)
 #ifdef USE_ASSERT_CHECKING
        printf("  -A 1|0          enable/disable run-time assert checking\n");
 #endif
-       printf("  -B NBUFFERS     number of shared buffers (default %d)\n", DEF_NBUFFERS);
+       printf("  -B NBUFFERS     number of shared buffers\n");
        printf("  -c NAME=VALUE   set run-time parameter\n");
        printf("  -d 0-5          debugging level (0 is off)\n");
        printf("  -D DATADIR      database directory\n");
@@ -2651,7 +2651,7 @@ PostgresMain(int argc, char *argv[], const char *username)
        if (!IsUnderPostmaster)
        {
                puts("\nPOSTGRES backend interactive interface ");
-               puts("$Revision: 1.360 $ $Date: 2003/08/13 16:16:23 $\n");
+               puts("$Revision: 1.361 $ $Date: 2003/08/26 15:38:24 $\n");
        }
 
        /*
index 684ca554472ea429bfe03d28e47fb4d8b9d95b71..0eb7039da73ff965b4802c54f864d0b4387d10ca 100644 (file)
@@ -70,4 +70,4 @@ bool          enableFsync = true;
 bool           allowSystemTableMods = false;
 int                    SortMem = 1024;
 int                    VacuumMem = 8192;
-int                    NBuffers = DEF_NBUFFERS;
+int                    NBuffers = 1000;
index 672e8dba651246cf58983031dac4781898e87eac..5160eadf1100d0ceaf29d7b8e4c7d4565c80927a 100644 (file)
@@ -944,7 +944,7 @@ static struct config_int ConfigureNamesInt[] =
                        NULL
                },
                &MaxBackends,
-               DEF_MAXBACKENDS, 1, INT_MAX, NULL, NULL
+               100, 1, INT_MAX, NULL, NULL
        },
 
        {
@@ -962,7 +962,7 @@ static struct config_int ConfigureNamesInt[] =
                        NULL
                },
                &NBuffers,
-               DEF_NBUFFERS, 16, INT_MAX, NULL, NULL
+               1000, 16, INT_MAX, NULL, NULL
        },
 
        {
index f506474c5eb7be8843efe40bb8000c3afe244a01..a30ae074a183c6d17735305963424024d422784f 100644 (file)
@@ -28,7 +28,7 @@
 # - Connection Settings -
 
 #tcpip_socket = false
-#max_connections = 32
+#max_connections = 100
        # note: increasing max_connections costs about 500 bytes of shared
        # memory per connection slot, in addition to costs from shared_buffers
         # and max_locks_per_transaction.
@@ -55,7 +55,7 @@
 
 # - Memory -
 
-#shared_buffers = 64           # min 16, at least max_connections*2, 8KB each
+#shared_buffers = 1000         # min 16, at least max_connections*2, 8KB each
 #sort_mem = 1024               # min 64, size in KB
 #vacuum_mem = 8192             # min 1024, size in KB
 
index ce947a3f4a004254130f8dc16d8d42121916ab5b..13e91f022c9eb7df7d876aa0e1879b060e5feddc 100644 (file)
@@ -586,8 +586,8 @@ $ECHO_N "creating configuration files... "$ECHO_C
 
 cp "$PG_HBA_SAMPLE" "$PGDATA"/pg_hba.conf              || exit_nicely
 cp "$PG_IDENT_SAMPLE" "$PGDATA"/pg_ident.conf          || exit_nicely
-sed -e "s/^#shared_buffers = 64/shared_buffers = $nbuffers/" \
-    -e "s/^#max_connections = 32/max_connections = $nconns/" \
+sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
+    -e "s/^#max_connections = 100/max_connections = $nconns/" \
     -e "s/^#lc_messages = 'C'/lc_messages = '`pg_getlocale MESSAGES`'/" \
     -e "s/^#lc_monetary = 'C'/lc_monetary = '`pg_getlocale MONETARY`'/" \
     -e "s/^#lc_numeric = 'C'/lc_numeric = '`pg_getlocale NUMERIC`'/" \
index 407243e6bd83797d3036311f993ddaf49ccf6b79..39c974a4f4af2dc0a01e1cac52c62e91e2a7c617 100644 (file)
@@ -191,17 +191,12 @@ extern int        VacuumMem;
  *     A few postmaster startup options are exported here so the
  *     configuration file processor can access them.
  */
-
 extern bool NetServer;
 extern bool EnableSSL;
 extern bool SilentMode;
 extern int     MaxBackends;
-
-#define DEF_MAXBACKENDS 32
 extern int     ReservedBackends;
 extern DLLIMPORT int NBuffers;
-
-#define DEF_NBUFFERS (DEF_MAXBACKENDS > 8 ? DEF_MAXBACKENDS * 2 : 16)
 extern int     PostPortNumber;
 extern int     Unix_socket_permissions;
 extern char *Unix_socket_group;