The incident: the API slowed down for a couple of minutes, which happens. But it didn't recover when the cause was fixed. Traffic stayed at several times the normal level until someone rate limited the mobile clients at the edge. The extra traffic came from installed apps retrying.
Retries are meant to hide short failures from users. Written carelessly, they multiply load exactly when the server can least handle it, and every installed copy of the app does it at once. Here's how that happens and what a well-behaved client does instead.
How retries amplify load
Immediate retries. A request fails, the app retries at once, maybe three times. During an outage every failing request becomes four requests. The server that was struggling with normal traffic now gets several times as much.
Retries at several layers. The networking library retries, the repository wrapper retries, and the screen has a "retry on error" effect.…