Episode Details
Back to Episodes
Understanding Why OS RAM and Postgres Buffer Cache Compete
Description
This story was originally published on HackerNoon at: https://hackernoon.com/understanding-why-os-ram-and-postgres-buffer-cache-compete.
Learn how PostgreSQL double buffering wastes RAM, increases latency, and hurts query performance — plus the 25% shared_buffers rule to fix it.
Check more stories related to programming at: https://hackernoon.com/c/programming.
You can also check exclusive content about #postgresql-double-buffering, #postgresql-shared_buffers, #pg_buffercache-analysis, #postgres-p95-latency, #postgresql-os-page-cache, #postgresql-memory-tuning, #effective_cache_size-tuning, #good-company, and more.
This story was written by: @tigerdata. Learn more about this writer by checking @tigerdata's about page,
and for more stories, please visit hackernoon.com.
Many PostgreSQL performance issues aren’t caused by too little RAM, but by allocating memory to the wrong layer. Postgres and the OS both cache the same data independently, creating a “double buffering” problem that wastes memory and increases latency. This guide explains how shared_buffers and the OS page cache interact, why the 25% shared_buffers rule matters, how to diagnose cache pressure with pg_buffercache, and when tuning stops helping because the dataset itself has outgrown memory.