diff options
author | Nathan Bossart <nathan@postgresql.org> | 2024-07-26 15:28:55 -0500 |
---|---|---|
committer | Nathan Bossart <nathan@postgresql.org> | 2024-07-26 15:28:55 -0500 |
commit | 0dcaea56903489e8abedf231f286272495c3beb4 (patch) | |
tree | 3c8bc2c6f4c1a6af0f2e3046f0d6a473af26b7c1 /src/backend/utils/misc/guc_tables.c | |
parent | 8a53539bd603e5fe8fa52bdbb7277f6f49724522 (diff) | |
download | postgresql-0dcaea56903489e8abedf231f286272495c3beb4.tar.gz postgresql-0dcaea56903489e8abedf231f286272495c3beb4.zip |
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
Diffstat (limited to 'src/backend/utils/misc/guc_tables.c')
-rw-r--r-- | src/backend/utils/misc/guc_tables.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c index f6fcdebb031..6a623f5f342 100644 --- a/src/backend/utils/misc/guc_tables.c +++ b/src/backend/utils/misc/guc_tables.c @@ -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; @@ -2284,6 +2285,17 @@ struct config_int ConfigureNamesInt[] = }, { + {"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."), gettext_noop("Specify 0 to have this value determined as a fraction of shared_buffers."), |