Prometheus TSDB Size Calculator
Calculate Prometheus TSDB block size based on series count and sample density.
About Prometheus TSDB Size Calculator
TSDB size scales with total sample count: samples = active_series × (86400 / scrape_interval) × retention_days, and raw size = samples × bytes_per_sample. Prometheus's TSDB uses delta-of-delta timestamp encoding and XOR-based value encoding within compacted blocks, meaningfully shrinking storage versus a naive per-sample byte cost — this calculator models that as a compaction ratio applied to the raw estimate.
Formula
tsdb_size_GB = active_series × bytes_per_sample × samples_per_day × retention_days / (1024^3)
- active_series
- Number of active time series
- bytes_per_sample
- Bytes per sample after compression
- samples_per_day
- 86400 / scrape_interval_sec
- retention_days
- Data retention period (days)
Worked example
With the default values below, Prometheus TSDB Size Calculator returns Estimated TSDB Size (compacted) of 49.52. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Active Seriesaccepts 1–100,000,000 series
- 50,000 series
- Scrape Intervalaccepts 1–3,600 seconds
- 15 seconds
- Retention Periodaccepts 1–3,650 days
- 15 days
- Bytes per Sample (raw)accepts 1–1,000 bytes
- 16 bytes
- Compaction Ratioaccepts 1–20 ×
- 1.3 ×
Results
- Estimated TSDB Size (compacted)
- 49.52 GB
- Raw Size Before Compaction
- 64.37 GB
- Compaction Savings
- 14.86 GB
- Total Samples Over Retention
- 4,320,000,000
Step by step
- 1Samples per series per day= 5760 samples/series/day
- 2Total samples over retention window= 4,320,000,000 samples
- 3Raw size before compaction= 64.37GB
- 4Compacted size= 49.52GB
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 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
What's Prometheus's actual typical bytes-per-sample after compaction?
Prometheus's own documentation cites roughly 1-2 bytes per sample after compaction for typical workloads, though this varies with label cardinality, value entropy (how much values actually change between scrapes), and time range.
Why does raw size assume 16 bytes per sample?
Before compaction, each sample conceptually carries an 8-byte timestamp, an 8-byte float64 value, plus label reference overhead — 16 bytes/sample is a reasonable uncompressed baseline before TSDB's delta/XOR encoding kicks in.
Does higher cardinality change compaction efficiency?
Yes — very high-cardinality series (especially ones with volatile label sets) compact less efficiently because there's more unique label metadata to store and less opportunity for XOR encoding to find small deltas between consecutive samples.
How can I check real TSDB size on disk?
Check the size of Prometheus's `data/` directory, or query `prometheus_tsdb_storage_blocks_bytes` for the current on-disk block size directly from Prometheus's own metrics.
Related Calculators
You might also need
- Prometheus Storage CalculatorCommonly used together
- Time Series Growth CalculatorCommonly used together
- Metrics Cardinality CalculatorCommonly used together
- Exporter Resource CalculatorCommonly used together
- Prometheus Retention CalculatorCommonly used together
- Scrape Interval CalculatorCommonly used together
