Swappiness Effect Calculator
Work out swappiness effect instantly with clear inputs, formula shown and shareable results.
About Swappiness Effect Calculator
vm.swappiness balances reclaim between anonymous process memory and page cache, on a scale where 0 strongly prefers dropping cache and 100 treats them equally — values above 100 favour swapping. It is not an on/off switch: even at 0 the kernel will swap rather than invoke the OOM killer. Latency-sensitive databases typically set it to 1 or 10.
Formula
Swappiness balance
anonymous reclaim share ~ swappiness / 200; page cache share = 1 - that; swappiness 0 still permits swap under real pressure
Worked example
With the default values below, Swappiness Effect Calculator returns Reclaim pressure applied to process memory of 30.0%. Change any input above and every figure here is recalculated in your browser.
Inputs used
- vm.swappiness valueaccepts 0–200
- 60
- Total RAMminimum 0.1 GB
- 32 GB
- Anonymous (process) memoryminimum 0 GB
- 24 GB
- Swap device latencyminimum 1 us
- 120 us
Results
- Reclaim pressure applied to process memory
- 30.0%
- Reclaim pressure applied to page cache
- 70.0%
- Process memory eligible for swapping
- 7.20 GB
- Latency penalty
- Each swapped page costs about 120 microseconds to fault back in, against roughly 0.1 for a RAM access
Step by step
- 1Values used
- 2Swappiness balance
- 3Reclaim pressure applied to process memory= 30.0
- 4Reclaim pressure applied to page cache= 70.0
- 5Process memory eligible for swapping= 7.20 GB
- 6Latency penalty= Each swapped page costs about 120 microseconds to fault back in, against roughly 0.1 for a RAM access
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
Should swappiness be 0?
It reduces swapping but does not prevent it, and it increases the chance of the OOM killer firing. A value of 1 to 10 is the usual recommendation for databases.
Why is high swappiness sometimes better?
On systems with idle memory-hungry processes and a heavy file workload, swapping out cold anonymous pages to keep more cache resident genuinely improves throughput.
Related Calculators
- Nice Priority Effect Calculator
- Account Lockout Policy Calculator
- Backup Size With Retention Calculator
- Bare Metal Sizing Calculator
- Bash Script Runtime Calculator
- Block Size Overhead Calculator
- Compression Ratio Savings Calculator
- Container vs VM Overhead Calculator
- Context Switch Rate Calculator
- CPU Steal Time Impact Calculator
You might also need
- Nice Priority Effect CalculatorAlso in Linux & System Administration
- Container vs VM Overhead CalculatorAlso in Linux & System Administration
- CPU Utilisation CalculatorAlso in Linux & System Administration
- Free Memory Estimate CalculatorAlso in Linux & System Administration
- Group Quota CalculatorAlso in Linux & System Administration
- Journal Size CalculatorAlso in Linux & System Administration
