Log Rotation Size Calculator
Calculate total disk space consumed by rotated log files based on logrotate retention policy.
About Log Rotation Size Calculator
logrotate keeps a configurable number of past log rotations on disk, and log volume typically grows over time as traffic increases. Summing the log size across all retained rotations — compounding a per-rotation growth rate — gives the worst-case uncompressed storage footprint. Since logrotate can compress all but the most recent rotation(s), applying a realistic compression ratio (commonly 10-20% of original size for repetitive text logs under gzip) shows the practical storage savings.
Formula
Total storage across rotations
total_storage = Σ log_size × (1 + growth_rate)^i for i = 0 to rotations-1
- S
- current log size per rotation
- g
- growth rate per rotation
- n
- number of rotations kept
Worked example
With the default values below, Log Rotation Size Calculator returns Total Storage (uncompressed) of 7,986.97. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Current Log Size (per rotation period)accepts 0–1,000,000 MB
- 500 MB
- Number of Rotations Keptaccepts 1–1,000
- 14
- Growth Rate per Rotationaccepts 0–50 %
- 2 %
- Compression Ratioaccepts 0.01–1
- 0.15
Results
- Total Storage (uncompressed)
- 7,986.97 MB
- Total Storage (compressed)
- 1,198.05 MB
- Storage Saved by Compression
- 6,788.92 MB
- Storage Savings
- 85.00%
Step by step
- 1Values used
- 2Total storage across rotations
- 3Total Storage (uncompressed)= 7,986.97 MB
- 4Total Storage (compressed)= 1,198.05 MB
- 5Storage Saved by Compression= 6,788.92 MB
- 6Storage Savings= 85.00
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 or fees or charges 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
How much does gzip typically compress log files?
Plain-text logs with repetitive structure (timestamps, common field names, repeated error strings) often compress to 10-20% of their original size under gzip, though highly variable content like binary dumps compresses less.
Why does logrotate leave the most recent log uncompressed?
The active or most recently rotated log is often left uncompressed briefly so tools like `tail -f` or log shippers can still read it easily; compression is applied on the next rotation cycle via the 'delaycompress' option.
How do I account for multiple log files (e.g. access + error logs)?
Run this calculator once per log file (or sum their current sizes together if they grow at similar rates) since each logrotate-managed file accumulates storage independently based on its own size and retention count.
