1 00:00:09,446 --> 00:00:13,046 Lee: Hello and welcome to Software Architecture Insights, your go-to 2 00:00:13,046 --> 00:00:17,186 resource for empowering software architects and aspiring professionals 3 00:00:17,456 --> 00:00:21,686 with the knowledge and tools they require to navigate the complex 4 00:00:21,686 --> 00:00:24,476 landscape of modern software design. 5 00:00:27,500 --> 00:00:32,390 On the 17th of August, GitHub had the kind of day that nobody wants. 6 00:00:33,280 --> 00:00:39,060 Issues, pull requests, The REST and GraphQL APIs, actions, 7 00:00:39,340 --> 00:00:46,080 Copilot, authentication, webhooks, all of it degraded or failing 8 00:00:46,859 --> 00:00:49,410 for seven and a half hours. 9 00:00:50,410 --> 00:00:56,750 At the peak, 56% of requests through the front door failed or crawled. 10 00:00:57,630 --> 00:01:01,309 About 29,000 organizations felt it. 11 00:01:01,970 --> 00:01:07,900 Roughly 4.8 million requests either failed outright or took long enough 12 00:01:08,080 --> 00:01:10,199 that the person waiting gave up. 13 00:01:11,689 --> 00:01:17,119 Now that's a bad day, and talking about it and digesting what happened is a fairly 14 00:01:17,129 --> 00:01:19,409 ordinary teardown postmortem review. 15 00:01:20,309 --> 00:01:23,129 But what makes this one worth your time is what happened in 16 00:01:23,129 --> 00:01:28,609 the three weeks around it GitHub published five incidents for August. 17 00:01:29,259 --> 00:01:31,189 Three of them are the same failure. 18 00:01:32,189 --> 00:01:37,869 On the sixth, a routine display reduced pod capacity in one data center. 19 00:01:38,859 --> 00:01:43,229 The sites still running went past their concurrency limits, and the 20 00:01:43,229 --> 00:01:48,249 service mesh sidecar started CPU throttling and restarting out of memory. 21 00:01:49,469 --> 00:01:52,509 The incident went on for 10 hours and 42 minutes 22 00:01:53,509 --> 00:01:57,179 On the 17th, a new traffic peak pushed one data center's load 23 00:01:57,189 --> 00:01:59,289 balancers past their limits. 24 00:02:00,059 --> 00:02:03,669 The service mesh sidecar hit its concurrency limit and 25 00:02:03,669 --> 00:02:05,079 didn't scale up correctly. 26 00:02:06,019 --> 00:02:10,399 Network flow limits ran out across multiple load balancer nodes. 27 00:02:11,399 --> 00:02:16,849 On the 26th, actions growth month over month outran the infrastructure, 28 00:02:17,229 --> 00:02:21,179 and a traffic burst saturated the shared database primary. 29 00:02:21,759 --> 00:02:29,499 One in five run starts failing at the peak Three times in three weeks, capacity 30 00:02:29,499 --> 00:02:31,839 ran out somewhere nobody was watching. 31 00:02:32,459 --> 00:02:36,189 Production traffic found the limit before any monitoring ever did. 32 00:02:37,629 --> 00:02:41,109 Three separate incidents, one underlying blind spot. 33 00:02:41,419 --> 00:02:44,669 And a blind spot at a company with GitHub's engineering depth 34 00:02:44,699 --> 00:02:48,549 is worth more of your attention than a single bad afternoon. 35 00:02:49,559 --> 00:02:50,849 Here is the idea. 36 00:02:51,269 --> 00:02:54,219 Your autoscaler scales the thing you are observing. 37 00:02:55,119 --> 00:02:58,929 Saturation happens in the thing that you don't observe. 38 00:02:59,949 --> 00:03:03,109 Think about what you actually have scaling policy set on. 39 00:03:04,049 --> 00:03:07,819 Pods probably, CPU, and memory. 40 00:03:08,859 --> 00:03:13,189 Maybe request rate or queue depth if you've done the work on those. 41 00:03:14,299 --> 00:03:16,449 Now think about what actually ran out at GitHub. 42 00:03:17,449 --> 00:03:23,499 Service mesh sidecar concurrency, network flow table entries on the load 43 00:03:23,509 --> 00:03:30,139 balancer node, headroom on a database primary once a fallback path turned on. 44 00:03:30,939 --> 00:03:34,769 Nobody writes a scaling policy against sidecar concurrency. 45 00:03:35,279 --> 00:03:38,269 I've never seen a dashboard with flow table entries on it, 46 00:03:38,659 --> 00:03:39,939 and I bet you haven't either. 47 00:03:40,809 --> 00:03:44,949 These limits have three things in common, and the combination 48 00:03:44,949 --> 00:03:46,679 is what makes them dangerous. 49 00:03:47,239 --> 00:03:51,309 They live deep in the infrastructure plumbing rather than up in your 50 00:03:51,309 --> 00:03:56,349 application, so they belong to a layer that somebody else chose. 51 00:03:57,359 --> 00:04:02,589 They're hard limits rather than soft ones, which means the behavior past the limit 52 00:04:02,589 --> 00:04:10,199 is a cliff instead of a slope, and they have no dashboard, hence no visibility. 53 00:04:11,629 --> 00:04:14,660 GitHub's own follow-up list gives the game away. 54 00:04:15,430 --> 00:04:19,360 Correct the autoscaling policies to account for sidecar concurrency. 55 00:04:20,120 --> 00:04:25,919 Audit request, concurrency, and scaling limits across the whole service mesh. 56 00:04:26,919 --> 00:04:30,440 They went looking for the limits they didn't know that they had. 57 00:04:30,939 --> 00:04:35,949 That's the work that was needed There's a second thread in the August 17th 58 00:04:35,969 --> 00:04:38,039 incident that deserves its own attention. 59 00:04:38,619 --> 00:04:43,359 A latent bug in client's retry logic amplified traffic into the 60 00:04:43,359 --> 00:04:45,219 shared gateway authentication path. 61 00:04:45,959 --> 00:04:52,129 So a capacity problem in one data center's load balancers became an authentication 62 00:04:52,129 --> 00:04:54,259 failure across the entire product. 63 00:04:55,309 --> 00:05:00,169 Sign-in is upstream of everything, which is why the blast radius covered 64 00:05:00,229 --> 00:05:06,129 everything, issues, pull requests, the APIs and actions, everything all at once. 65 00:05:07,430 --> 00:05:11,289 Part of GitHub's remediation was blocking the retry triggering 66 00:05:11,289 --> 00:05:13,219 requests to that endpoint. 67 00:05:13,799 --> 00:05:17,260 In other words, to recover from the outage, they first had to stop their 68 00:05:17,260 --> 00:05:19,099 own clients from hammering them. 69 00:05:20,099 --> 00:05:24,289 Retry logic tends to get written once early in a product life cycle 70 00:05:24,439 --> 00:05:26,549 by whoever was creating the client. 71 00:05:27,199 --> 00:05:32,249 Then nobody touches it for years, and it sits there quietly working the same 72 00:05:32,249 --> 00:05:34,739 way, whether it's effective or not. 73 00:05:36,239 --> 00:05:42,079 GitHub's follow-up is to review and fix retry and backoff limits in its clients 74 00:05:42,369 --> 00:05:45,599 to prevent amplification cascades. 75 00:05:46,149 --> 00:05:51,079 It's worth stealing that sentence for your own backlog One more interesting 76 00:05:51,099 --> 00:05:53,319 thing from the 26th incident. 77 00:05:53,739 --> 00:05:54,739 This one is short. 78 00:05:55,859 --> 00:06:01,039 They had protective throttles, but the throttles were set too high, so they 79 00:06:01,039 --> 00:06:04,139 engaged after the damage was already done. 80 00:06:04,809 --> 00:06:08,999 Engineers tuned them by hand during the incident, then raised them back 81 00:06:08,999 --> 00:06:11,209 gradually while watching telemetry. 82 00:06:12,509 --> 00:06:14,159 The circuit breaker was there. 83 00:06:14,619 --> 00:06:18,449 It was configured to trip after the fire was already burning. 84 00:06:19,449 --> 00:06:22,629 Their fix is to make it automatic rather than manual. 85 00:06:23,219 --> 00:06:29,259 A throttle a human has to set during an incident is not a safety mechanism. 86 00:06:29,839 --> 00:06:32,559 It's a second job for somebody who already has one. 87 00:06:33,559 --> 00:06:35,879 So two things for you to do. 88 00:06:36,209 --> 00:06:40,479 First, go find as many of your real hard limits as you can. 89 00:06:41,049 --> 00:06:45,439 I don't mean your capacity plan, which covers the resources you decided to buy. 90 00:06:45,939 --> 00:06:51,029 I mean the limits sitting inside the layers that you didn't choose Sidecar 91 00:06:51,029 --> 00:06:58,329 concurrency, connection tables, flow tables, file descriptors, thread pools, 92 00:06:58,709 --> 00:07:01,039 database connections, queue depths. 93 00:07:02,059 --> 00:07:05,329 For each one of those, ask yourself two questions. 94 00:07:06,069 --> 00:07:07,609 Do you know what the limit is? 95 00:07:07,799 --> 00:07:11,239 And does anything tell you before the limit is reached? 96 00:07:12,729 --> 00:07:17,379 Most teams can't answer the first question for most of the list, and that 97 00:07:17,379 --> 00:07:21,299 by itself is a finding worth taking to your next architecture review. 98 00:07:22,729 --> 00:07:25,149 Second, go read your retry code. 99 00:07:25,689 --> 00:07:29,149 When a dependency starts failing, does the client back off? 100 00:07:29,739 --> 00:07:34,699 And is there any cap on total retry volume across all of your clients at once? 101 00:07:35,689 --> 00:07:41,299 If a retry storm is possible, then every hard limit on that first list stops being 102 00:07:41,299 --> 00:07:44,689 a slowdown and turns into an outage. 103 00:07:46,059 --> 00:07:49,309 That's the connection between the two lists, and it's why GitHub's 104 00:07:49,329 --> 00:07:54,199 bad day was seven and a half hours instead of 40 minutes. 105 00:07:55,199 --> 00:07:59,129 A link to GitHub's August availability report is in the show notes. 106 00:07:59,479 --> 00:08:04,039 It covers all five of these incidents, and it's more specific than most 107 00:08:04,039 --> 00:08:07,139 companies are willing to talk about their own capacity limits. 108 00:08:07,469 --> 00:08:08,429 Hats off to them. 109 00:08:09,049 --> 00:08:13,209 By publishing the information, they are holding themselves accountable, and 110 00:08:13,209 --> 00:08:14,869 they're helping the rest of the industry. 111 00:08:15,639 --> 00:08:16,489 Take a look at it. 112 00:08:16,859 --> 00:08:20,109 Read the whole month rather than just the 17th incident. 113 00:08:20,429 --> 00:08:22,639 The pattern is the point 114 00:08:41,193 --> 00:08:44,103 Lee: Thank you for joining us on Software Architecture Insights. 115 00:08:44,703 --> 00:08:48,813 If you found this episode interesting, please tell your friends and colleagues. 116 00:08:49,233 --> 00:08:51,843 You can listen to Software Architecture Insights on all 117 00:08:51,843 --> 00:08:53,763 of the major podcast platforms. 118 00:08:54,783 --> 00:08:58,703 And if you want more from me, take a look at some of my many articles 119 00:08:58,703 --> 00:09:01,563 at softwarearchitectureinsights.com. 120 00:09:01,563 --> 00:09:07,463 And while you're there, join the 2000 people who have subscribed to my 121 00:09:07,463 --> 00:09:12,323 newsletter, so you always get my latest content as soon as it's available. 122 00:09:17,530 --> 00:09:20,380 Thank you for listening to Software Architecture Insights.