Sparse Whisper series reserve full retention archives: diagnosing aggregation for low-traffic metrics
0 reputation · 03 Oct 2023, 08:38 UTC
0 reputation · 03 Oct 2023, 08:38 UTC
Whisper databases pre-allocate space for every archive in the retention schema, so a metric receiving one point per day still reserves the same blocks as a high-traffic series. For low-traffic workloads, this fixed allocation is the primary storage cost. storage-schemas.conf defines the archives, while storage-aggregation.conf sets aggregationMethod and xFilesFactor per pattern.
carbon-aggregator can downsample into lower-resolution archives, but its regex rules apply globally and overlapping patterns can double-aggregate or drop points. Graphite/Carbon 1.x is in maintenance mode, so behavior is stable but not evolving. The unresolved decision is how to configure aggregation for sparse series without distorting signals: sum on a sparse counter may overstate, while avg may understate; a high xFilesFactor can discard valid low-density points.
Which aggregationMethod preserves sparse counter semantics? How should xFilesFactor be tuned per archive for irregular low-traffic series? Does carbon-aggregator offer net storage savings over its added latency and failure surface for very low traffic?
31775 reputation · 03 Oct 2023, 09:38 UTC
For sparse counter metrics, use aggregationMethod = sum so each down‑sampled archive stores the cumulative total. Set xFilesFactor low (e.g., 0.1 or 0.0) on the lower‑resolution archives so that a single daily point is not discarded when the aggregation window contains many null slots. carbon-aggregator rarely provides net storage savings for very low‑traffic series; its added latency, failure surface, and risk of double‑aggregation outweigh the modest block reduction because Whisper pre‑allocates the same blocks regardless of aggregation.
sum preserves counter semanticssum adds the increments that occurred in each source interval, yielding the correct total for the target interval.avg normalises to a rate (value / seconds) and will under‑report when many source slots are null, because the average is taken over the whole window including the nulls.last or max lose the cumulative nature and are only appropriate for gauges.xFilesFactor per archive0.5 or raise it if you want to reject intervals with many gaps.xFilesFactor = 0.1. A single point in a 10‑minute window yields 1/10 = 0.1 non‑null fraction, so it is retained.xFilesFactor = 0.0 or 0.01. This guarantees that even a solitary daily point survives aggregation.Lowering xFilesFactor too far can keep intermittent nulls as valid data, masking real gaps. Choose the smallest value that still reflects the expected minimum point density for each archive.
storage-schemas.conf, down‑sampling via carbon‑aggregator does not reduce the number of allocated blocks.# 1. Inspect archive configuration and actual point counts
whisper-info.py /path/to/metric.wsp
# 2. Generate a controlled sparse series (one point per day for 30 days)
for i in {1..30}; do
echo "test.metric $(date -d "$i days ago" +%s):1" | nc -q0 localhost 2003
done
# 3. After retention rolls, compare stored values with expected sums
whisper-fetch.py /path/to/metric.wsp | tail -30
If the fetched values match the manual sum of the injected points, the sum/xFilesFactor settings are correct.
What is the exact retention schema (archive resolutions and durations) defined in storage-schemas.conf for the sparse metric? The optimal xFilesFactor per archive depends on those intervals.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.