Get the latest tech news
Postgres LISTEN/NOTIFY does not scale
Postgres LISTEN/NOTIFY can cause severe performance issues under high write concurrency due to a global lock during commit. Learn why it doesn't scale and how to avoid outages.
After reading through the surrounding code and a call sites, we found that this lock is acquired during COMMIT queries when a transaction has previously issued a NOTIFY. We re-implemented the notification system by having the application send an HTTP request to running bots that needed to have their configurations updated. We considered implementing a proper pub/sub system, for example through Redis, but as this notification was only used in a single part of our code, we decided to take the simpler path.
Or read this on Hacker News