Why Postgres Cache Gets Pricier with Connections: Huge Pages Explained
arpit_bhayani · x · 2026-07-27
Arpit Bhayani explains why PostgreSQL's sharedbuffers cache becomes more expensive as connection counts rise. Because the OS manages memory in default 4 KB pages, each backend process maps the entire shared buffer segment, causing page table entries to scale linearly with connections.
The article notes that enabling Huge Pages (THP, e.g., 2 MB pages) mitigates this. Larger pages drastically reduce page table entries, allowing the TLB (Translation Lookaside Buffer) to cover almost the entire hot working set, bypassing page table lookups during reads. ClickHouse's managed Postgres even pins buffer caches to huge pages and refuses to boot if it fails, preventing silent fallbacks to 4 KB pages.
Related event: Why Postgres Shared Buffers Get Pricier with More Connections(2 posts)→
More from Infra
- LightRAG v1.5.3 adds a one-time Milvus migration and hardens production edge cases — JeremyCMorgan · 2026-07-28
- llama.cpp adds DSpark speculative decoding and asks for speed results — pmttyji · 2026-07-28
- Nvidia puts an open vision-language-action model on Hugging Face — theteknosaur · 2026-07-28
- “Model eats harness” is really about deployment-driven harness evolution — m_wulfmeier · 2026-07-28
- Agentic AI system reportedly cost $1.2M a month before being cut to $100K — emmanuelvivier · 2026-07-28
- Wistron’s Early Nvidia Bet Turned It Into One of AI’s Biggest Supply-Chain Winners — pstAsiatech · 2026-07-28