Latest / The CTO Podcast with Fexingo: Technical Leadership, Architecture, and Engineering Org / How Cloudflare Cut DNS Query Costs by 60 Percent
Transcript
- Lucas: So, a number that has been stuck in my head all week: Cloudflare handles on the order of ten trillion DNS queries a day. Ten trillion. And the team there just figured out how to cut the cost of each one by sixty percent. Luna: Sixty percent is a massive number. I remember when they talked about moving to their own edge servers and using kernel bypass, but this sounds like a different level. Lucas: It is. The public story is that they built their own custom silicon, an ASIC, specifically for DNS processing. But the more interesting part, at least for me, is how they redesigned the entire software stack around it. This wasn't just dropping in a faster chip. Luna: Right, because the chip is only as good as the code that runs on it. What did they actually change? Lucas: Well, they stripped out the operating system's networking stack almost entirely. On a typical server, when a DNS packet arrives, it goes through multiple layers of the kernel, and that takes time and CPU cycles. Cloudflare's custom implementation bypasses all of that. The packet goes straight from the network interface into a dedicated memory region that the ASIC can access directly. Luna: So they're essentially building a specialized pipeline. It's like a factory line where every worker knows exactly what to do with the box, no wasted motion. Lucas: Exactly. And the result is that they can now do the same amount of work with a fraction of the servers. The power draw per query has dropped, which is a huge deal when you're running data centers around the globe. That's where the sixty percent cost saving really comes from, it's a combination of lower capital expenditure and lower operational costs. Luna: That makes sense. But I have to ask, what's the catch? There's usually a trade-off when you go custom. Lucas: The catch is flexibility. A general-purpose CPU can handle anything you throw at it, but an ASIC is built for one job. So Cloudflare is betting that DNS will remain a fundamental protocol for the foreseeable future. And they're probably right, but it also means they have to be very careful about adding new features that might require changing the hardware. Luna: It's like they've committed to a specific architecture path. That's a bold move for a company that's also known for rapid innovation. Lucas: It is bold, but they've been thinking about this for years. They have a hardware team that's been around since 2020, and they've already shipped custom chips for other parts of their network, like TLS termination. This DNS ASIC is just the latest piece in a longer strategy. Luna: I love that they're not just optimizing for speed, but for cost per query. That's a metric that most companies don't even track. Lucas: And that's often the difference between a good engineering org and a great one. It's easy to add more servers, but it takes real discipline to ask how can we do more with less. The savings here are so significant that they're probably pass on some of it to their customers, which is why you see DNS resolution times getting faster across the board. Luna: For sure. I mean, we've all seen the speed tests where Cloudflare's name always pops up at the top. But now they're also thinking about the environmental cost. Lower power consumption is a big win for sustainability too. Lucas: Absolutely. And speaking of cost, I got a message from a listener who said these episodes have changed how they approach their own infrastructure budget. It reminded me that this show is entirely ad-free, and that's thanks to a small but generous community of listeners. Luna: Yeah, it's a nice model. It means we can have honest conversations without worrying about pleasing sponsors. Lucas: So if you've gotten value out of these episodes, a couple of dollars a month on buy me a coffee dot com slash fexingo is genuinely what keeps the lights on. It makes a real difference. Luna: Every little bit helps, and it keeps us independent. Lucas: Alright, back to the architecture. So the real lesson here isn't just about building custom silicon, it's about thinking deeply about where your costs actually are. Most companies have a vague sense that their infrastructure is expensive, but they never do the kind of analysis that Cloudflare did. Luna: It's surprisingly rare to hear about a cost reduction that's tied to a fundamental architectural change, rather than just negotiating better cloud contracts. Lucas: Exactly. And that's why I wanted to feature this story. It's a blueprint for how to approach infrastructure at scale. Start by measuring everything, then find the bottlenecks, and then make a bold bet that aligns with your long-term product direction. Luna: One thing I'm curious about, though, is how they handled the transition. You don't just flip a switch and move from one architecture to another overnight. Lucas: They ran a hybrid mode for a while. The new asic based servers handled a growing share of the traffic while the old ones stayed in place as a safety net. They also did a lot of simulation and testing with recorded traffic patterns to make sure the new system could handle the wildest spikes. Luna: That's prudent. And it also gives you a chance to train your team on the new system without the pressure of a complete cutover. Lucas: Right. And that's another takeaway for engineering leaders: the rollout strategy is just as important as the technology itself. They could have gone all-in on day one, but they chose a gradual approach that minimized risk. Luna: So what's next for Cloudflare after this win? Do they plan to expand this custom approach to other parts of their stack? Lucas: I think so. They've already hinted that this is part of a broader trend toward purpose-built silicon. The TLDR is that for companies with massive, predictable workloads, the economics of custom hardware become very attractive. You just have to be sure that your workload isn't going to change drastically in the next few years. Luna: It's a trade-off between flexibility and efficiency. And it sounds like for Cloudflare, the bet is paying off. I'm curious to see if other CDNs or cloud providers follow suit. Lucas: That's a great question. We're seeing hyperscalers like Google and Amazon design their own chips for AI and networking. But for a company like Cloudflare, which sits between the user and the origin server, having that control over the data path is a competitive advantage. Luna: It also changes the conversation with customers. If you can say we handle your traffic with 60 percent less energy, that's a strong selling point. Lucas: For sure. And I think that's a big part of why they're so public about these numbers. It's not just about internal efficiency, it's also about signaling to the market that they're the most technically sophisticated player in the space. Luna: So for a CTO listening, what's the one thing they should take away from this episode? Lucas: I'd say it's the importance of looking at your infrastructure costs as a strategic lever, not just a monthly expense. Sometimes the biggest savings come from a fundamental rethink, not incremental tweaks. And that requires leadership buy-in and a willingness to invest in R&D. Luna: I think that's a great note to end on. Thanks for joining us, and we'll be back next week with another deep dive.