Resizing shared buffer pool in a running PostgreSQL server: important, yet impossible
summary
Demonstrates a Linux-first patch that resizes PostgreSQL shared_buffers without restart by reserving large mmap address space, using madvise to add or remove backing pages, and coordinating backends with a proxy signal barrier so a coordinator evicts or aborts on pinned pages. Expansion populates new pages; shrinking flushes and removes evicted pages. Users change config, run pg_reload_conf and call pg_resize_shared_buffers, which returns true on success. Windows support is not included yet.
AI-written summary · about
chapters (9)
- 0:00Introduction and motivation
- 4:23Shared memory architecture in PostgreSQL
- 10:00Shared buffer pool structures
- 13:17Challenges of resizing buffers
- 16:50Approaches to resizable shared memory
- 22:09Resizing protocol and synchronization
- 27:29Proxy signal barrier mechanism
- 31:00User perspective and fallback
- 33:28Windows and multi-threading considerations
related talks
45mEnhancing PostgreSQL Plasticity: New Frontiers in Memory Management
52mChanging shared_buffers on the fly
39mPostgreSQL: Page Buffer Overview
57mPostgreSQL When It's Not Your Job
58mScaling Postgres
50mInside PostgreSQL Shared Memory
55mScaling PostgreSQL: Horizontal vs. Vertical
46mHow we made PG Fitter, Happier, More Productive
