{"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"}],"derived_content_hash":"3a8f0a1ec91f002b9539475494e00743b0a22944c020fbe1dbffa0e5d5ff8f1c","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"],"repair_provenance":{"original_source_revision":"english-manuals:f6ca08b35d2881ab703bee5b343db3298a479789db1c6b630498bcaaf7865310","receipt_sha256":"1b62cefc9a27de9c307538bcd71318b6d0864148dff4d7ed9cf3b90c5c1502b2","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:dd1879234674f718b05388739f0a036b50f445a98deb0a857a0cb61f12e9c7a7","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"num_os_semaphores","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"num_os_semaphores","SourceRevision":"wiki-repair-20261023:dd1879234674f718b05388739f0a036b50f445a98deb0a857a0cb61f12e9c7a7","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.","description_zh":"根据配置的最大连接数（max_connections）、允许的自动清理工作进程数（autovacuum_max_workers）、允许的 WAL 发送进程数（max_wal_senders）、允许的后台进程数（max_worker_processes）等，报告服务器所需的信号量数量。","description_zh_html":"\u003cp\u003e\n        根据配置的最大连接数（\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-connection.html#GUC-MAX-CONNECTIONS\"\u003emax_connections\u003c/a\u003e）、允许的自动清理工作进程数（\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-vacuum.html#GUC-AUTOVACUUM-MAX-WORKERS\"\u003eautovacuum_max_workers\u003c/a\u003e）、允许的 WAL 发送进程数（\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-replication.html#GUC-MAX-WAL-SENDERS\"\u003emax_wal_senders\u003c/a\u003e）、允许的后台进程数（\u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-resource.html#GUC-MAX-WORKER-PROCESSES\"\u003emax_worker_processes\u003c/a\u003e）等，报告服务器所需的信号量数量。\n       \u003c/p\u003e","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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-preset.html","sha256":"d0e95b9a81d5fdf853df26eba7dc096d96b9b45dadda13e0d0353aa72ac7a7b9"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-pgdoc"},"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":"center","Version":"18","Locale":"en","Title":"num_os_semaphores","Summary":"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.","BodyHTML":"\u003cp\u003eReports 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.\u003c/p\u003e","SourceRevision":"wiki-repair-20261023:dd1879234674f718b05388739f0a036b50f445a98deb0a857a0cb61f12e9c7a7","ContentHash":"44334d2fa745b12bbb44160e6895bd3bbada414e3e41862494ad5d0a6e57af90","Payload":{"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."}},"RequestedLocale":"en","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
