Kernel Parameter Sizing Calculator
Work out kernel parameter sizing instantly with clear inputs, formula shown and shareable results.
About Kernel Parameter Sizing Calculator
vm.dirty_ratio caps how much page cache may hold unwritten data before writers are blocked, and on a large-memory system the default 20 percent can be many gigabytes — which takes tens of seconds to flush and produces long write stalls. Sizing it so a full flush completes in a few seconds is the usual fix on database and log-heavy servers.
Formula
Kernel sizing
fs.file-max ~ 3 x concurrent connections; dirty bytes = RAM x dirty_ratio; flush time = dirty bytes / disk write throughput
Worked example
With the default values below, Kernel Parameter Sizing Calculator returns Recommended fs.file-max of 300,000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Total RAMminimum 0.1 GB
- 64 GB
- Concurrent TCP connectionsminimum 1
- 100,000
- vm.dirty_ratioaccepts 1–90 %
- 20 %
- Disk write throughputminimum 1 MB/s
- 500 MB/s
Results
- Recommended fs.file-max
- 300,000
- Dirty page cache the ratio permits
- 11.92 GiB
- Time to flush a full dirty cache
- 25.60 s
- Recommended net.core.somaxconn
- 5,000
Step by step
- 1Values used
- 2Kernel sizing
- 3Recommended fs.file-max= 300,000
- 4Dirty page cache the ratio permits= 12,800,000,000
- 5Time to flush a full dirty cache= 25.60 s
- 6Recommended net.core.somaxconn= 5,000
Assumptions and limits
- The result is derived only from the 4 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
Why do write stalls happen?
When dirty pages reach dirty_ratio the kernel blocks the writing process until enough data is flushed. With gigabytes of dirty data and a slow disk that pause is measured in seconds.
Should dirty_bytes be used instead of dirty_ratio?
On large-memory machines yes. An absolute byte limit is independent of RAM size and gives predictable flush duration.
Related Calculators
- Bare Metal Sizing Calculator
- Kernel Upgrade Downtime Calculator
- LVM Sizing Calculator
- Page Cache Sizing Calculator
- Parallel Job (xargs) Sizing Calculator
- TCP Backlog Sizing Calculator
- Tmpfs Sizing Calculator
- Account Lockout Policy Calculator
- Backup Size With Retention Calculator
- Bash Script Runtime Calculator
You might also need
- LVM Sizing CalculatorAlso in Linux & System Administration
- Tmpfs Sizing CalculatorAlso in Linux & System Administration
- Bare Metal Sizing CalculatorAlso in Linux & System Administration
- Kernel Upgrade Downtime CalculatorAlso in Linux & System Administration
- Page Cache Sizing CalculatorAlso in Linux & System Administration
- TCP Backlog Sizing CalculatorAlso in Linux & System Administration
