Skip to content

Commit

Permalink
Improve defaults shown in postgresql.conf.sample and pg_settings
Browse files Browse the repository at this point in the history
Previously, these showed unlikely default values.  The new default value
128MB (since PG 10) is not always accurate since initdb tries several
increasing values, but it likely to be accurate.

Reported-by: Zhangjie <[email protected]>

Discussion: https://postgr.es/m/TYWPR01MB7678772FD8640C404F1DC882F9079@TYWPR01MB7678.jpnprd01.prod.outlook.com

Author: Zhangjie

Backpatch-through: master
  • Loading branch information
bmomjian committed Aug 23, 2021
1 parent a3fcbcd commit f7bda63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ static struct config_int ConfigureNamesInt[] =
GUC_UNIT_BLOCKS
},
&NBuffers,
1024, 16, INT_MAX / 2,
16384, 16, INT_MAX / 2,
NULL, NULL, NULL
},

Expand Down
2 changes: 1 addition & 1 deletion src/backend/utils/misc/postgresql.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

# - Memory -

#shared_buffers = 32MB # min 128kB
#shared_buffers = 128MB # min 128kB
# (change requires restart)
#huge_pages = try # on, off, or try
# (change requires restart)
Expand Down
2 changes: 1 addition & 1 deletion src/bin/initdb/initdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ setup_config(void)
else
snprintf(repltok, sizeof(repltok), "shared_buffers = %dkB",
n_buffers * (BLCKSZ / 1024));
conflines = replace_token(conflines, "#shared_buffers = 32MB", repltok);
conflines = replace_token(conflines, "#shared_buffers = 128MB", repltok);

#ifdef HAVE_UNIX_SOCKETS
snprintf(repltok, sizeof(repltok), "#unix_socket_directories = '%s'",
Expand Down

0 comments on commit f7bda63

Please sign in to comment.