{"Entry":{"collection":"guc","key":"num_os_semaphores","name":"num_os_semaphores","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Preset Options","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"17","status":"added","to":"18"}],"content_hash":"b900fc1ec13fbfe7e6d92214bd87a556085b2315816407c4367b9be1be7d9a5c","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"0"}],"editorial":{"advice":{"olap":"Not tunable. Use num_os_semaphores to verify format, build, or resource assumptions on analytical nodes and keep every read/write candidate compatible.","oltp":"Not tunable. Record num_os_semaphores as a deployment/capability fact; if it is unexpected, fix the binary, initdb, or database-creation process rather than trying SET.","small":"Not tunable. Preserve it in inventory and incident reports; do not custom-build or rebuild merely to change it without a demonstrated compatibility need."},"mechanism":["Shows the number of semaphores required for the server. It is read-only and cannot be changed with SET or configuration-file edits.","It is computed from the startup process and connection configuration so administrators can plan System V semaphore capacity.","Interpret it with shared_memory_size, shared_memory_size_in_huge_pages, huge_pages. Applications and operations tooling may read num_os_semaphores for capability or environment detection, but cannot SET it; cross-cluster comparisons must account for build, initdb, and current-database differences."],"pitfalls":["Trying to change read-only num_os_semaphores with SET or a configuration file.","Assuming every cluster, database, or vendor build reports the same value.","Ignoring the value in file-format or feature-compatibility checks.","Treating reported metadata as a performance target instead of an environment fact."],"references":[{"title":"PostgreSQL 19 Beta 4: num_os_semaphores","url":"https://www.postgresql.org/docs/19/runtime-config-preset.html#GUC-NUM-OS-SEMAPHORES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["shared_memory_size","shared_memory_size_in_huge_pages","huge_pages","huge_pages_status","max_connections","block_size"],"summary":"num_os_semaphores — Shows the number of semaphores required for the server. Observed in PG18–19 Beta 4; its last measured boot default is 0 in PG19 Beta 4, with internal context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"18","group":"Preset Options","group_slug":"preset","imported_at":"2026-09-27T17:57:31.795276+08:00","intro_commit":{"authored_at":"2024-07-26T15:28:55-05:00","discussion":["https://postgr.es/m/20240517164452.GA1914161%40nathanxps13"],"hash":"0dcaea56903489e8abedf231f286272495c3beb4","subject":"Introduce num_os_semaphores GUC.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0dcaea56903489e8abedf231f286272495c3beb4"},"key":"num_os_semaphores","last_version":"20","max_val":"","min_val":"","name":"num_os_semaphores","position":301,"present_in":["18","19","20"],"short_desc":"Reports the number of semaphores that are needed for the server based on the configured number of allowed connections (max_connections), allowed autovacuum worker processes (autovacuum_max_workers), allowed WAL sender processes (max_wal_senders), allowed background processes (max_worker_processes), etc.","short_desc_zh":"","source_rev":"english-manuals:f6ca08b35d2881ab703bee5b343db3298a479789db1c6b630498bcaaf7865310","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"num_os_semaphores","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"num_os_semaphores","SourceRevision":"english-manuals:f6ca08b35d2881ab703bee5b343db3298a479789db1c6b630498bcaaf7865310","Facts":{"boot_val":"0","category":"Preset Options","context":"internal","description":"Reports the number of semaphores that are needed for the server based on the configured number of allowed connections (max_connections), allowed autovacuum worker processes (autovacuum_max_workers), allowed WAL sender processes (max_wal_senders), allowed background processes (max_worker_processes), etc.","doc":{"anchor":"GUC-NUM-OS-SEMAPHORES","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"num_os_semaphores","short_desc":"Shows the number of semaphores required for the server.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-NUM-OS-SEMAPHORES","file":"runtime-config-preset.html","lang":"en","sha256":"4dbfec727b9cee838adefb8a766217748d91ab90190b452a58cec737459582ce","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"num_os_semaphores","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"num_os_semaphores","Summary":"","BodyHTML":"\u003cp\u003e根据配置的最大连接数（\u003ca href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\" rel=\"nofollow\"\u003emax_connections\u003c/a\u003e）、允许的自动清理工作进程数（\u003ca href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-WORKERS\" rel=\"nofollow\"\u003eautovacuum_max_workers\u003c/a\u003e）、允许的 WAL 发送进程数（\u003ca href=\"/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\" rel=\"nofollow\"\u003emax_wal_senders\u003c/a\u003e）、允许的后台进程数（\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\" rel=\"nofollow\"\u003emax_worker_processes\u003c/a\u003e）等，报告服务器所需的信号量数量。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"0f47d0d972b7ab24be0ae45ad86bb6f8efcc713d25cd9c0b0e307c7615ff3fbd","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e根据配置的最大连接数（\u003ca href=\"/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e）、允许的自动清理工作进程数（\u003ca href=\"/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-WORKERS\"\u003eautovacuum_max_workers\u003c/a\u003e）、允许的 WAL 发送进程数（\u003ca href=\"/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\"\u003emax_wal_senders\u003c/a\u003e）、允许的后台进程数（\u003ca href=\"/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"\u003emax_worker_processes\u003c/a\u003e）等，报告服务器所需的信号量数量。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
