Buffer Cache Calculator
Estimate buffer cache size used for block device I/O buffering on Linux systems.
About Buffer Cache Calculator
Buffer cache (the Buffers field in /proc/meminfo) holds metadata-level block I/O buffers, distinct from the file-content page cache (Cached). Dirty pages are modified data waiting to be flushed to disk; the kernel starts background writeback once dirty memory crosses vm.dirty_background_ratio, and — if writeback can't keep pace — throttles writing processes once dirty memory reaches the harder vm.dirty_ratio threshold, which can cause visible application stalls on write-heavy workloads.
Formula
Dirty page flush threshold
dirty_threshold = MemTotal × vm.dirty_ratio%
- T
- MemTotal
- r
- vm.dirty_ratio fraction
Worked example
With the default values below, Buffer Cache Calculator returns Buffer Cache (MB) of 300. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Buffers (MB, from /proc/meminfo)minimum 0
- 300
- Dirty (MB, unwritten pages)minimum 0
- 40
- Writeback (MB, currently being flushed)minimum 0
- 5
- vm.dirty_ratio (%)accepts 1–100
- 20
- MemTotal (MB)minimum 1
- 16,384
Results
- Buffer Cache (MB)
- 300
- Dirty Page Status
- Dirty pages well below the flush threshold — writeback is keeping up comfortably.
- Dirty Page Flush Threshold (MB)
- 3,277
- Dirty Pages as % of Threshold
- 1.22%
- Dirty Pages as % of RAM
- 0.24%
- Writeback (MB, currently flushing)
- 5
Step by step
- 1Values used
- 2Dirty page flush threshold
- 3Buffer Cache (MB)= 300
- 4Dirty Page Status= Dirty pages well below the flush threshold — writeback is keeping up comfortably.
- 5Dirty Page Flush Threshold (MB)= 3,277
- 6Dirty Pages as % of Threshold= 1.22
- 7Dirty Pages as % of RAM= 0.24
- 8Writeback (MB, currently flushing)= 5
Assumptions and limits
- The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What's the difference between vm.dirty_background_ratio and vm.dirty_ratio?
dirty_background_ratio (default 10%) is a soft threshold that starts asynchronous background flushing without blocking applications. dirty_ratio (default 20%) is a hard threshold — if dirty memory reaches it, the process actually writing data is forced to block synchronously until enough is flushed, directly impacting application latency.
Why would I lower vm.dirty_ratio?
On systems with large RAM and slower storage, a high dirty_ratio can let gigabytes of unwritten data accumulate before flushing starts in earnest, risking a large burst of I/O (and potential data loss on power failure) all at once. Lowering it trades some write throughput for smoother, more predictable writeback behavior.
Are Buffers and Dirty the same thing?
No — Buffers tracks block-device metadata buffering in general, while Dirty specifically tracks pages (from any cache) that have been modified in memory but not yet written to disk. A page can be part of Cached and also counted in Dirty if it's been modified since being read.
