{"Entry":{"collection":"guc","key":"max_notify_queue_pages","name":"max_notify_queue_pages","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Disk","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"16","status":"added","to":"17"}],"content_hash":"5adb16c471a547f9da54a04aef4be12d11f1d5bae0e46f89f12a079093728043","context":"","default_changed_in":[],"default_history":[{"from":"17","to":"19","value":"1048576"}],"editorial":{"advice":{"olap":"An OLAP label does not justify a larger queue. Long analytical transactions in listening sessions can delay cleanup, so separate listeners from long transactions and measure notification production versus consumption.","oltp":"Monitor pg_notification_queue_usage() and identify listeners that remain in long transactions before increasing capacity. Size the disk-backed queue from the maximum tolerated notification backlog and available database volume, not query scan throughput.","small":"Keep the default unless the application has a verified LISTEN/NOTIFY backlog requirement. More pages permit more disk consumption and postpone failure; they do not fix a stalled listener."},"mechanism":["max_notify_queue_pages caps the number of database pages that the disk-backed LISTEN/NOTIFY queue may allocate. At the usual 8kB BLCKSZ, the PG18 default permits up to 8GB.","Notifications remain queued until all listening sessions have consumed or no longer need them. A listener that stays inside a long transaction can prevent cleanup and let queue usage grow.","This is disk capacity, not notify_buffers memory and not a limit on one payload. When the queue is full, transactions attempting NOTIFY can fail at commit. Its postmaster context fixes the value at server start; changing it requires a restart."],"pitfalls":["Increasing queue capacity instead of fixing a listener that stays inside a long transaction.","Confusing max_notify_queue_pages disk capacity with notify_buffers shared-memory cache.","Forgetting that, with 8kB pages, the default 1048576 pages permits up to about 8GB.","Assuming a larger queue changes an individual NOTIFY payload limit or delivery semantics."],"references":[{"title":"PostgreSQL 19 Beta 4: max_notify_queue_pages","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-MAX-NOTIFY-QUEUE-PAGES"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["notify_buffers","track_activities","max_connections","shared_buffers"],"summary":"max_notify_queue_pages — Sets the maximum number of allocated pages for NOTIFY / LISTEN queue. Observed in PG17–19 Beta 4; its last measured boot default is 1048576 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"17","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:31.707752+08:00","intro_commit":{"authored_at":"2023-11-29T01:41:48+02:00","discussion":["https://postgr.es/m/CACG%3DezZe1NQSCnfHOr78AtAZxJZeCvxrts0ygrxYwe%3DpyyjVWA%40mail.gmail.com","https://postgr.es/m/CAJ7c6TPDOYBYrnCAeyndkBktO0WG2xSdYduTF0nxq%2BvfkmTF5Q%40mail.gmail.com"],"hash":"2cdf131c46e631addfc386f6106e52a1b8cc3a70","subject":"Use larger segment file names for pg_notify","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2cdf131c46e631addfc386f6106e52a1b8cc3a70"},"key":"max_notify_queue_pages","last_version":"20","max_val":"","min_val":"","name":"max_notify_queue_pages","position":272,"present_in":["17","18","19","20"],"short_desc":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue.","short_desc_zh":"","source_rev":"english-manuals:b4c44e64ee83e323953dc509adaa71d484c7b83d9fd13780223ad6a925da40ef","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_notify_queue_pages","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_notify_queue_pages","SourceRevision":"english-manuals:b4c44e64ee83e323953dc509adaa71d484c7b83d9fd13780223ad6a925da40ef","Facts":{"boot_val":"1048576","category":"Resource Usage / Disk","context":"postmaster","description":"Specifies the maximum amount of allocated pages for NOTIFY / LISTEN queue. The default value is 1048576. For 8 KB pages it allows to consume up to 8 GB of disk space. This parameter can only be set at server start.","doc":{"anchor":"GUC-MAX-NOTIFY-QUEUE-PAGES","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"64","name":"max_notify_queue_pages","short_desc":"Sets the maximum number of allocated pages for NOTIFY / LISTEN queue.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-NOTIFY-QUEUE-PAGES","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_notify_queue_pages","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"max_notify_queue_pages","Summary":"","BodyHTML":"\u003cp\u003e指定\u003ca href=\"/docs/18/sql-notify.html\" title=\"NOTIFY\" rel=\"nofollow\"\u003e\u003cspan\u003eNOTIFY\u003c/span\u003e\u003c/a\u003e / \u003ca href=\"/docs/18/sql-listen.html\" title=\"LISTEN\" rel=\"nofollow\"\u003e\u003cspan\u003eLISTEN\u003c/span\u003e\u003c/a\u003e队列可分配页面的最大数量。默认值是 1048576。对于 8 KB 页面，这允许最多消耗 8 GB 的磁盘空间。此参数只能在服务器启动时设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"aac19c879bc59c5d3171978dab0ee87a9619a754ed28647aa12d3dacf0574525","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定\u003ca href=\"/docs/18/sql-notify.html\" title=\"NOTIFY\"\u003e\u003cspan class=\"refentrytitle\"\u003eNOTIFY\u003c/span\u003e\u003c/a\u003e / \u003ca href=\"/docs/18/sql-listen.html\" title=\"LISTEN\"\u003e\u003cspan class=\"refentrytitle\"\u003eLISTEN\u003c/span\u003e\u003c/a\u003e队列可分配页面的最大数量。默认值是 1048576。对于 8 KB 页面，这允许最多消耗 8 GB 的磁盘空间。此参数只能在服务器启动时设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
