← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Postgres LISTEN/NOTIFY can scale to 60K writes/second despite global lock concerns

🔄 Updated 2h ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Postgres LISTEN/NOTIFY can achieve 60K writes/second.
  • Optimization overcomes global lock scalability concerns.
  • Initial implementation bottlenecked at 2.9K writes/second.
  • Enables low-latency streaming and pub/sub applications.

Challenging LISTEN/NOTIFY Scalability Myths

Postgres LISTEN/NOTIFY has historically been viewed as unscalable due to a global lock that causes unintuitive performance characteristics. This perception has led many to avoid using it for high-throughput applications. However, new findings indicate that these limitations are not inherent and can be overcome through optimization.

Achieving High Throughput with Optimization

Through specific optimizations, LISTEN/NOTIFY-backed streams were able to achieve 60,000 writes per second on a single Postgres server, maintaining millisecond-scale latency. This performance significantly surpasses the 2,900 writes per second observed in an initial, unoptimized implementation, which bottlenecked without visible resource consumption.

LISTEN/NOTIFY for Low-Latency Streaming

LISTEN/NOTIFY is a powerful tool for low-latency durable notifications, streams, and pub/sub within Postgres. It allows readers to block and wait for notifications, waking up immediately when new data arrives, which is more efficient than continuous polling. This mechanism is particularly useful for applications requiring real-time updates, such as LLM response token streaming.

Understanding the Global Lock

The core of the scalability challenge lies in a global lock that Postgres takes during NOTIFY operations. While this lock creates performance bottlenecks in unoptimized setups, understanding its behavior is key to developing strategies that mitigate its impact and allow LISTEN/NOTIFY to scale effectively for demanding applications.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~15 min · 15 stories · Jul 24

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

A new analysis demonstrates that Postgres LISTEN/NOTIFY, often criticized for scalability issues due to a global lock, can achieve 60,000 writes per second on a single server with millisecond latency when optimized. This finding challenges previous assumptions about its limitations for low-latency notifications, streams, and pub/sub applications. The optimization addresses the unintuitive performance characteristics caused by the global lock, making LISTEN/NOTIFY a viable tool for high-throughput streaming use cases.