mirror of
https://github.com/postgres/postgres.git
synced 2025-06-26 12:21:12 +03:00
Introduce num_os_semaphores GUC.
The documentation for System V IPC parameters provides complicated formulas to determine the appropriate values for SEMMNI and SEMMNS. Furthermore, these formulas have often been wrong because folks forget to update them (e.g., when adding a new auxiliary process). This commit introduces a new runtime-computed GUC named num_os_semaphores that reports the number of semaphores needed for the configured number of allowed connections, worker processes, etc. This new GUC allows us to simplify the formulas in the documentation, and it should help prevent future inaccuracies. Like the other runtime-computed GUCs, users can view it with "postgres -C" before starting the server, which is useful for preconfiguring the necessary operating system resources. Reviewed-by: Tom Lane, Sami Imseih, Andres Freund, Robert Haas Discussion: https://postgr.es/m/20240517164452.GA1914161%40nathanxps13
This commit is contained in:
@ -591,6 +591,7 @@ static int segment_size;
|
||||
static int shared_memory_size_mb;
|
||||
static int shared_memory_size_in_huge_pages;
|
||||
static int wal_block_size;
|
||||
static int num_os_semaphores;
|
||||
static bool data_checksums;
|
||||
static bool integer_datetimes;
|
||||
|
||||
@ -2283,6 +2284,17 @@ struct config_int ConfigureNamesInt[] =
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"num_os_semaphores", PGC_INTERNAL, PRESET_OPTIONS,
|
||||
gettext_noop("Shows the number of semaphores required for the server."),
|
||||
NULL,
|
||||
GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE | GUC_RUNTIME_COMPUTED
|
||||
},
|
||||
&num_os_semaphores,
|
||||
0, 0, INT_MAX,
|
||||
NULL, NULL, NULL
|
||||
},
|
||||
|
||||
{
|
||||
{"commit_timestamp_buffers", PGC_POSTMASTER, RESOURCES_MEM,
|
||||
gettext_noop("Sets the size of the dedicated buffer pool used for the commit timestamp cache."),
|
||||
|
Reference in New Issue
Block a user