Abstract
On Tuesday, September 16th, at around 01:50 UTC, a Mender deployment was created from a single tenant targeting about 16,000 devices with a very short polling interval. This caused a sudden load and memory spike in the Deployments Service, the Device Auth Service, and MongoDB. Unfortunately, the MongoDB cluster was unable to scale automatically at that time due to the sudden spike. As a result, we had to first deactivate the Deployments Service, abort the massive deployment, and then allow MongoDB to recover properly. Only then were we able to scale it up and restore full operations.
We apologize for the disruption this incident caused. We know that hosted Mender can scale well under certain conditions, but in this case the scaling was too slow and we have to address this issue.
Incident Timeline
What went wrong
The Mender Server is currently managing more than 500.000 active devices, which usually poll the API server at long intervals (hours or once per day). Under these conditions, the Deployments Service typically serves about 30 deployments per minute on average, with peaks of around 1,000 per minute. In this case, however, a single deployment targeted about 16,000 devices with a polling interval of 5 minutes or less. As a result, all deployments started nearly simultaneously, leaving neither MongoDB nor the Kubernetes cluster enough time to scale up properly. Both MongoDB and the Deployments Service went out of memory.
In short, hosted Mender cannot currently handle this type of sudden load, and we must address this issue.
What we did in the short term
What should we do in the long term
We already have a very basic rate limiting in the API server, but it must be improved to protect hosted Mender from usage patterns that could negatively impact other customers, and to allow the Kubernetes and the MongoDB cluster to scale up properly. We will commit to implementing a new set of rate limits.