config: Split "Worker Processes" out of "Asynchronous Behavior"
authorAndres Freund <andres@anarazel.de>
Tue, 11 Feb 2025 16:39:19 +0000 (11:39 -0500)
committerAndres Freund <andres@anarazel.de>
Tue, 11 Feb 2025 17:53:40 +0000 (12:53 -0500)
Having all the worker related GUCs in the same section as IO controlling GUCs
doesn't really make sense. Create a separate section for them.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/x3tlw2jk5gm3r3mv47hwrshffyw7halpczkfbk3peksxds7bvc@lguk43z3bsyq

doc/src/sgml/config.sgml
src/backend/utils/misc/guc_tables.c
src/backend/utils/misc/postgresql.conf.sample
src/include/utils/guc_tables.h

index 38244409e3c900753d1579af35df4da9d6a4682a..bd0dffa3e2491b41fe9e35bbd9d43a6b068fe533 100644 (file)
@@ -2618,7 +2618,13 @@ include_dir 'conf.d'
         </para>
        </listitem>
       </varlistentry>
+     </variablelist>
+    </sect2>
 
+    <sect2 id="runtime-config-resource-worker-processes">
+     <title>Worker Processes</title>
+
+     <variablelist>
       <varlistentry id="guc-max-worker-processes" xreflabel="max_worker_processes">
        <term><varname>max_worker_processes</varname> (<type>integer</type>)
        <indexterm>
index ce7534d4d23a929fa2a1d2097bf50e0d980168c5..779b6098adae66e61e33c2eae018c6f4f8dbc930 100644 (file)
@@ -683,6 +683,7 @@ const char *const config_group_names[] =
    [RESOURCES_KERNEL] = gettext_noop("Resource Usage / Kernel Resources"),
    [RESOURCES_BGWRITER] = gettext_noop("Resource Usage / Background Writer"),
    [RESOURCES_ASYNCHRONOUS] = gettext_noop("Resource Usage / Asynchronous Behavior"),
+   [RESOURCES_WORKER_PROCESSES] = gettext_noop("Resource Usage / Worker Processes"),
    [WAL_SETTINGS] = gettext_noop("Write-Ahead Log / Settings"),
    [WAL_CHECKPOINTS] = gettext_noop("Write-Ahead Log / Checkpoints"),
    [WAL_ARCHIVING] = gettext_noop("Write-Ahead Log / Archiving"),
@@ -1962,7 +1963,7 @@ struct config_bool ConfigureNamesBool[] =
    },
 
    {
-       {"parallel_leader_participation", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
+       {"parallel_leader_participation", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
            gettext_noop("Controls whether Gather and Gather Merge also run subplans."),
            gettext_noop("Should gather nodes also run subplans or just gather tuples?"),
            GUC_EXPLAIN
@@ -3234,7 +3235,7 @@ struct config_int ConfigureNamesInt[] =
    {
        {"max_worker_processes",
            PGC_POSTMASTER,
-           RESOURCES_ASYNCHRONOUS,
+           RESOURCES_WORKER_PROCESSES,
            gettext_noop("Maximum number of concurrent worker processes."),
            NULL,
        },
@@ -3496,7 +3497,7 @@ struct config_int ConfigureNamesInt[] =
    },
 
    {
-       {"max_parallel_maintenance_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
+       {"max_parallel_maintenance_workers", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
            gettext_noop("Sets the maximum number of parallel processes per maintenance operation."),
            NULL
        },
@@ -3506,7 +3507,7 @@ struct config_int ConfigureNamesInt[] =
    },
 
    {
-       {"max_parallel_workers_per_gather", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
+       {"max_parallel_workers_per_gather", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
            gettext_noop("Sets the maximum number of parallel processes per executor node."),
            NULL,
            GUC_EXPLAIN
@@ -3517,7 +3518,7 @@ struct config_int ConfigureNamesInt[] =
    },
 
    {
-       {"max_parallel_workers", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
+       {"max_parallel_workers", PGC_USERSET, RESOURCES_WORKER_PROCESSES,
            gettext_noop("Sets the maximum number of parallel workers that can be active at one time."),
            NULL,
            GUC_EXPLAIN
index c40b7a3121e7f39a7f79b74d374d5eb060f79ee1..7a77238646ee701e520fa5c4337259e2a39fc36e 100644 (file)
 #effective_io_concurrency = 1      # 1-1000; 0 disables prefetching
 #maintenance_io_concurrency = 10   # 1-1000; 0 disables prefetching
 #io_combine_limit = 128kB      # usually 1-32 blocks (depends on OS)
+
+# - Worker Processes -
+
 #max_worker_processes = 8      # (change requires restart)
 #max_parallel_workers_per_gather = 2   # limited by max_parallel_workers
 #max_parallel_maintenance_workers = 2  # limited by max_parallel_workers
index 3f18ff451ef32ac6b4ee7a5e1f73a3c4e7ab7846..0b16b4dcf57d686f3474236fd25e61106135a69c 100644 (file)
@@ -65,6 +65,7 @@ enum config_group
    RESOURCES_KERNEL,
    RESOURCES_BGWRITER,
    RESOURCES_ASYNCHRONOUS,
+   RESOURCES_WORKER_PROCESSES,
    WAL_SETTINGS,
    WAL_CHECKPOINTS,
    WAL_ARCHIVING,