Forecasting Models
How to forecast service load: simple growth, seasonal decomposition, Prophet / ARIMA, and when ML is overkill.
Overview
Simple models usually win
Capacity planning needs forecasts, and forecasting is its own discipline. The good news: most production services don't need fancy models; simple ones work.
The forecast hierarchy, lowest to highest sophistication
- 1. Linear extrapolation — "Last quarter we grew 20%. Forecast 20% next quarter." — Steady, organic-growth services — Fails on saturation, viral growth or seasonality
- 2. Linear with seasonality — 20% growth applied to the same daily, weekly and yearly shape: peak hour 5× off-peak, Black Friday 3× a normal day — Most consumer services; standard in capacity sheets — Regime changes
- 3. Exponential smoothing (Holt-Winters) — Trend + seasonality + level, weighted by recency; in most spreadsheets and Python statsmodels — Trends that shift — Less formal than ARIMA
- 4. ARIMA / SARIMA — Auto-Regressive Integrated Moving Average: formal time-series modeling of correlations, seasonality, trends — Formal statistical rigor — Needs care with stationarity and parameter selection
- 5. Prophet (Facebook) — Built for business forecasting at scale: holidays, multiple seasonalities, trend changes — "Better than linear without learning ARIMA"; the industry-standard middle ground — Tuning effort
- 6. ML (LSTM, Transformer, custom) — Complex patterns, many inputs, large datasets — Fraud detection, recommendation, retail demand forecasting — Heavyweight; almost always overkill for "how many servers next month"
The 80/20 of forecasting for SRE
- Linear with seasonality — 80%
- Prophet — 15%: irregular events, complex seasonality
- ML — 5%: unusual patterns, business-critical accuracy
Accuracy metrics
- MAPE (Mean Absolute Percentage Error): average of |actual - forecast| / actual. The standard metric.
- MAE (Mean Absolute Error): average of |actual - forecast|, in absolute units.
- Forecast bias: mean(forecast - actual). Persistently positive means consistent over-forecasting.
> [!TIP] For capacity planning, aim for MAPE [!NOTE] Driver-based forecasts beat naive trends when leading indicators are good, and lose when the business indicators are themselves uncertain.
Capacity-specific gotchas
- Forecasting averages — Misses peaks: forecast peak QPS, not average
- Compositional changes — A new feature changes the mix of work; old QPS forecasts undercount its cost
- Failure-mode shifts — Onboarding an APAC customer moves peak from 8pm to 6am; region-level forecasts matter
- Non-stationarity — Past patterns may not hold; retrain after a major product change
Key concepts
- Linear with seasonality
- 80% of SRE capacity needs. Daily/weekly/yearly cycles + linear growth trend.
- Prophet (Facebook)
- Open-source forecasting for business time series. Handles holidays, multiple seasonalities. Industry standard middle-ground.
- MAPE
- Mean Absolute Percentage Error. Standard accuracy metric for forecasts. < 20% is good for quarterly capacity.
- Driver-based forecast
- Predict from leading indicators (MAU, marketing spend, business projections), not from past traffic alone.
- Forecast bias
- Persistent over- or under-forecasting. mean(forecast - actual) over a window. Should trend to 0.
When to use it
- Quarterly capacity planning — model the next 90 days
- Pre-event sizing — Black Friday, marketing campaign
- Post-launch capacity tracking — actual vs forecast for new features
- Cost forecasting — predict cloud spend
Interview questions
- When should I use Prophet vs simple linear forecasting?
- How do you incorporate marketing campaigns or product launches into a forecast?
- What's a good MAPE for capacity-planning forecasts?
Sign up free to read the full topic
More SRE topics
Start free on Cariara · Coding problems · System design studio