Lee:
00:00:09
Hello and welcome to Software Architecture Insights, your go-to
Lee:
00:00:13
resource for empowering software architects and aspiring professionals
Lee:
00:00:17
with the knowledge and tools they require to navigate the complex
Lee:
00:00:21
landscape of modern software design.
Lee:
00:00:27
On the 17th of August, GitHub had the kind of day that nobody wants.
Lee:
00:00:33
Issues, pull requests, The REST and GraphQL APIs, actions,
Lee:
00:00:39
Copilot, authentication, webhooks, all of it degraded or failing
Lee:
00:00:46
for seven and a half hours.
Lee:
00:00:50
At the peak, 56% of requests through the front door failed or crawled.
Lee:
00:00:57
About 29,000 organizations felt it.
Lee:
00:01:01
Roughly 4.8 million requests either failed outright or took long enough
Lee:
00:01:08
that the person waiting gave up.
Lee:
00:01:11
Now that's a bad day, and talking about it and digesting what happened is a fairly
Lee:
00:01:17
ordinary teardown postmortem review.
Lee:
00:01:20
But what makes this one worth your time is what happened in
Lee:
00:01:23
the three weeks around it GitHub published five incidents for August.
Lee:
00:01:29
Three of them are the same failure.
Lee:
00:01:32
On the sixth, a routine display reduced pod capacity in one data center.
Lee:
00:01:38
The sites still running went past their concurrency limits, and the
Lee:
00:01:43
service mesh sidecar started CPU throttling and restarting out of memory.
Lee:
00:01:49
The incident went on for 10 hours and 42 minutes
Lee:
00:01:53
On the 17th, a new traffic peak pushed one data center's load
Lee:
00:01:57
balancers past their limits.
Lee:
00:02:00
The service mesh sidecar hit its concurrency limit and
Lee:
00:02:03
didn't scale up correctly.
Lee:
00:02:06
Network flow limits ran out across multiple load balancer nodes.
Lee:
00:02:11
On the 26th, actions growth month over month outran the infrastructure,
Lee:
00:02:17
and a traffic burst saturated the shared database primary.
Lee:
00:02:21
One in five run starts failing at the peak Three times in three weeks, capacity
Lee:
00:02:29
ran out somewhere nobody was watching.
Lee:
00:02:32
Production traffic found the limit before any monitoring ever did.
Lee:
00:02:37
Three separate incidents, one underlying blind spot.
Lee:
00:02:41
And a blind spot at a company with GitHub's engineering depth
Lee:
00:02:44
is worth more of your attention than a single bad afternoon.
Lee:
00:02:49
Here is the idea.
Lee:
00:02:51
Your autoscaler scales the thing you are observing.
Lee:
00:02:55
Saturation happens in the thing that you don't observe.
Lee:
00:02:59
Think about what you actually have scaling policy set on.
Lee:
00:03:04
Pods probably, CPU, and memory.
Lee:
00:03:08
Maybe request rate or queue depth if you've done the work on those.
Lee:
00:03:14
Now think about what actually ran out at GitHub.
Lee:
00:03:17
Service mesh sidecar concurrency, network flow table entries on the load
Lee:
00:03:23
balancer node, headroom on a database primary once a fallback path turned on.
Lee:
00:03:30
Nobody writes a scaling policy against sidecar concurrency.
Lee:
00:03:35
I've never seen a dashboard with flow table entries on it,
Lee:
00:03:38
and I bet you haven't either.
Lee:
00:03:40
These limits have three things in common, and the combination
Lee:
00:03:44
is what makes them dangerous.
Lee:
00:03:47
They live deep in the infrastructure plumbing rather than up in your
Lee:
00:03:51
application, so they belong to a layer that somebody else chose.
Lee:
00:03:57
They're hard limits rather than soft ones, which means the behavior past the limit
Lee:
00:04:02
is a cliff instead of a slope, and they have no dashboard, hence no visibility.
Lee:
00:04:11
GitHub's own follow-up list gives the game away.
Lee:
00:04:15
Correct the autoscaling policies to account for sidecar concurrency.
Lee:
00:04:20
Audit request, concurrency, and scaling limits across the whole service mesh.
Lee:
00:04:26
They went looking for the limits they didn't know that they had.
Lee:
00:04:30
That's the work that was needed There's a second thread in the August 17th
Lee:
00:04:35
incident that deserves its own attention.
Lee:
00:04:38
A latent bug in client's retry logic amplified traffic into the
Lee:
00:04:43
shared gateway authentication path.
Lee:
00:04:45
So a capacity problem in one data center's load balancers became an authentication
Lee:
00:04:52
failure across the entire product.
Lee:
00:04:55
Sign-in is upstream of everything, which is why the blast radius covered
Lee:
00:05:00
everything, issues, pull requests, the APIs and actions, everything all at once.
Lee:
00:05:07
Part of GitHub's remediation was blocking the retry triggering
Lee:
00:05:11
requests to that endpoint.
Lee:
00:05:13
In other words, to recover from the outage, they first had to stop their
Lee:
00:05:17
own clients from hammering them.
Lee:
00:05:20
Retry logic tends to get written once early in a product life cycle
Lee:
00:05:24
by whoever was creating the client.
Lee:
00:05:27
Then nobody touches it for years, and it sits there quietly working the same
Lee:
00:05:32
way, whether it's effective or not.
Lee:
00:05:36
GitHub's follow-up is to review and fix retry and backoff limits in its clients
Lee:
00:05:42
to prevent amplification cascades.
Lee:
00:05:46
It's worth stealing that sentence for your own backlog One more interesting
Lee:
00:05:51
thing from the 26th incident.
Lee:
00:05:53
This one is short.
Lee:
00:05:55
They had protective throttles, but the throttles were set too high, so they
Lee:
00:06:01
engaged after the damage was already done.
Lee:
00:06:04
Engineers tuned them by hand during the incident, then raised them back
Lee:
00:06:08
gradually while watching telemetry.
Lee:
00:06:12
The circuit breaker was there.
Lee:
00:06:14
It was configured to trip after the fire was already burning.
Lee:
00:06:19
Their fix is to make it automatic rather than manual.
Lee:
00:06:23
A throttle a human has to set during an incident is not a safety mechanism.
Lee:
00:06:29
It's a second job for somebody who already has one.
Lee:
00:06:33
So two things for you to do.
Lee:
00:06:36
First, go find as many of your real hard limits as you can.
Lee:
00:06:41
I don't mean your capacity plan, which covers the resources you decided to buy.
Lee:
00:06:45
I mean the limits sitting inside the layers that you didn't choose Sidecar
Lee:
00:06:51
concurrency, connection tables, flow tables, file descriptors, thread pools,
Lee:
00:06:58
database connections, queue depths.
Lee:
00:07:02
For each one of those, ask yourself two questions.
Lee:
00:07:06
Do you know what the limit is?
Lee:
00:07:07
And does anything tell you before the limit is reached?
Lee:
00:07:12
Most teams can't answer the first question for most of the list, and that
Lee:
00:07:17
by itself is a finding worth taking to your next architecture review.
Lee:
00:07:22
Second, go read your retry code.
Lee:
00:07:25
When a dependency starts failing, does the client back off?
Lee:
00:07:29
And is there any cap on total retry volume across all of your clients at once?
Lee:
00:07:35
If a retry storm is possible, then every hard limit on that first list stops being
Lee:
00:07:41
a slowdown and turns into an outage.
Lee:
00:07:46
That's the connection between the two lists, and it's why GitHub's
Lee:
00:07:49
bad day was seven and a half hours instead of 40 minutes.
Lee:
00:07:55
A link to GitHub's August availability report is in the show notes.
Lee:
00:07:59
It covers all five of these incidents, and it's more specific than most
Lee:
00:08:04
companies are willing to talk about their own capacity limits.
Lee:
00:08:07
Hats off to them.
Lee:
00:08:09
By publishing the information, they are holding themselves accountable, and
Lee:
00:08:13
they're helping the rest of the industry.
Lee:
00:08:15
Take a look at it.
Lee:
00:08:16
Read the whole month rather than just the 17th incident.
Lee:
00:08:20
The pattern is the point
Lee:
00:08:41
Thank you for joining us on Software Architecture Insights.
Lee:
00:08:44
If you found this episode interesting, please tell your friends and colleagues.
Lee:
00:08:49
You can listen to Software Architecture Insights on all
Lee:
00:08:51
of the major podcast platforms.
Lee:
00:08:54
And if you want more from me, take a look at some of my many articles
Lee:
00:08:58
at softwarearchitectureinsights.com.
Lee:
00:09:01
And while you're there, join the 2000 people who have subscribed to my
Lee:
00:09:07
newsletter, so you always get my latest content as soon as it's available.
Lee:
00:09:17
Thank you for listening to Software Architecture Insights.