Prompt
Why is my time-series DB using so much disk space?
Latest observation
Time-series databases often use a lot of disk because they’re optimized for fast writes, retention, and querying over time, not just minimal storage. The most common reasons are:
1. High cardinality
If you have lots of unique combinations of labels/tags like:
hostservicepoduser_idrequest_id
…the DB stores more index and metadata, which can explode disk usage.
2. Too much raw data
You may be ingesting:
- very frequent samples
- many metrics per device/service
- large payloads or verbose tags
Even “small” records add up quickly at high volume.
3. Retention is longer than you think
Old data may not be getting deleted or compacted yet. Some TSDBs keep data in:
- active segments
- WAL / write-ahead logs
- compaction buffers
- tombstoned data waiting for cleanup
4. Compression isn’t helping enough
Compression works best when data is:
- regular
- numeric
- low-cardinality
- well-ordered by time
If your data is noisy, sparse, or contains lots of strings, compression may be poor.
5. Indexes are large
TSDBs usually maintain indexes for fast queries by tags/labels. Large or high-cardinality tag sets can make indexes a big part of total disk use.
6. Chunks/blocks and compaction overhead
Many TSDBs store data in time blocks. During compaction, disk use can temporarily spike because:
- old and new copies coexist
- partial merges exist
- cleanup is delayed
7. WAL and temporary files
Write-ahead logs, caches, and temp files can take substantial space, especially if:
- ingestion is high
- compaction is lagging
- the DB was recently restarted or crashed
8. Downsampling/rollups not configured
If you store every raw point forever, disk usage grows quickly. Without:
- downsampling
- aggregation
- retention tiers
…you keep all high-resolution data.
9. Duplicate or near-duplicate data
Sometimes the pipeline sends:
- repeated points
- retries without deduplication
- metrics from multiple exporters with overlapping labels
That can multiply storage usage.
What to check first
- Cardinality of metrics/tags/labels
- Retention policies
- WAL and compaction status
- Largest series/tables/indexes
- Whether you’re storing unnecessary labels or raw data
Common fixes
- Drop or normalize high-cardinality labels
- Shorten retention
- Add downsampling/rollups
- Increase compaction efficiency / tune flush settings
- Deduplicate at ingest
- Remove unused metrics
- Separate hot vs. cold data
If you want, tell me which time-series database you’re using (InfluxDB, Prometheus, TimescaleDB, VictoriaMetrics, OpenTSDB, etc.) and I can give you a more specific checklist and the exact commands to inspect disk usage.