MongoDBA. Jesse Jiryu Davis, Matthieu HumeauProblem & solution
MongoDB Predictive Auto-Scaling: An Experiment
Summary
MongoDB Atlas initially relied on a reactive auto-scaler that took minutes to adjust instance sizes and only transitioned between adjacent tiers. Because these delays caused transient server over-utilization or unnecessary customer costs, researchers prototyped predictive auto-scaling to forecast demand. The experimental architecture used short-term and long-term forecasters for customer-driven metrics, an estimator using boosted decision trees to project CPU utilization, and a planner to pick the most cost-effective tier. In testing, the prototype kept replica sets closer to target CPU ranges while saving an average of nine cents per replica set hourly. MongoDB subsequently implemented a production version that scales replica sets up proactively before expected spikes while retaining reactive downscaling.
Context
MongoDB Atlas previously used only reactive auto-scaling, which scaled instances only between adjacent tiers after detecting several minutes of overload or hours of underload. Scaling operations take several minutes, leaving instances temporarily underloaded or overloaded during sudden workload shifts.
Approach / What changed
Researchers prototyped a predictive auto-scaler consisting of a long-term forecaster using MSTL and ARIMA, a short-term trend interpolation forecaster, a boosted decision tree CPU estimator, and a planner that selects the cheapest tier to keep CPU utilization under 75 percent.
Takeaways
Forecasting models targeted exogenous customer-driven metrics such as queries per second and scanned-objects rate to avoid circular feedback loops caused by scaling CPU capacity.
The experimental long-term forecaster included a self-censoring confidence mechanism to disregard its predictions for non-seasonal replica sets when recent errors grew large.
The production rollout in MongoDB Atlas operates conservatively by predicting scale-up events while relying on the reactive auto-scaler to downscale instances after load drops.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.