PostgreSQL and Linux Kernel interactions
summary
Shows how PostgreSQL actually calls the kernel: process forks use clone to spawn workers, shared memory uses mmap MAP_SHARED, and signals implement latch coordination (WaitLatch/SetLatch) rather than vague “IPC.” Demonstrations use strace, perf, fincore and /proc to find where postgres blocks, quantify double buffering (kernel page cache plus Postgres buffers), and show that enabling direct I/O removes kernel caching. Examples cover copy_file_range and io_uring usage, PG16/17 vectorized preads, fallocate, sync_file_range, and prefetch via fadvise.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 2:45What are you going to learn?
- 5:32Strace basics
- 7:20Interactions with kernel (high level view)
- 9:27System call examples
- 13:28Process management
- 15:22Memory, Signals
- 20:03Buffered & Direct I/O
- 24:42With and without I/O Combining (PG16 & PG17)
- 25:33Prefetch, Misc system calls, New usages
related talks
56mPostgreSQL at low Level: stay curious!
46mInvestigating Multithreaded PostgreSQL
41mLinux IO internals for PostgreSQL administrators in 2023
26mLinux and PostgreSQL in the Multiverse of Connections
50mInside PostgreSQL Shared Memory
51mHow does PostgreSQL actually work
27mAnalyzing Postgres performance problems using perf and eBPF
47mIPC in PostgreSQL
