IPC in PostgreSQL
summary
Postgres moves from polling and blocking IO toward precise nonblocking wakeups using a check_for_interrupt cooperative hook, shared-memory latches (added 2010) and epoll/kqueue multiplexing; the postmaster refactor in v16 removes risky fork-inside-handler code and the walreceiver stops waking 10×/sec. IPC uses PM signals and proc signals (including a recent proc signal barrier that asks every backend to reach its next interrupt point). Remaining work includes finer-grained interrupt masks and a nonblocking subprocess module to avoid blocking while running archiver/copy programs.
AI-written summary · about
chapters (14)
- 0:00Introduction
- 4:10Hardware
- 11:14Common mistakes
- 21:14Sleeping system calls
- 22:59Latches
- 24:14Latch
- 31:44PM Signals
- 33:44Proc Signals
- 35:10Proximal Barrier
- 36:27Check for interrupts
- 39:25Improvements
- 40:15Subprocess module
- 41:01Possible changes
- 41:18The Unix way
related talks
01h 06mIO in PostgreSQL: Past, Present, Future
30mPostgreSQL and Linux Kernel interactions
46mInvestigating Multithreaded PostgreSQL
41mLinux IO internals for PostgreSQL administrators in 2023
48mThe path to using AIO in postgres
49mAIO in PG 18 and beyond
49mStreaming I/O and vectored I/O
52mMulti-threaded PostgreSQL?
