Cloudflare Achieves Major Performance Leap with Rust-Based System Rewrite
In a significant move to enhance network speed and security, Cloudflare has announced the completion of a year-long project to rebuild core components of its global network infrastructure. The result? A substantial reduction in latency – a median decrease of 10 milliseconds – and a 25% performance boost as measured by independent CDN performance tests. This upgrade impacts millions of customers relying on Cloudflare’s services.
At the heart of this transformation lies the replacement of FL, a 15-year-old system responsible for critical security and performance features. The new system, dubbed FL2, is built upon Rust and Cloudflare’s proprietary Rust-based proxy framework, Oxy. This shift not only accelerates performance but also lays the groundwork for faster development cycles and a more robust security posture.
The Power of Rust: Eliminating Bugs and Boosting Efficiency
Cloudflare has become increasingly proficient in Rust, recognizing its potential to address longstanding challenges in its infrastructure. Oxy, built entirely in Rust, effectively eliminates entire classes of bugs that plagued the previous Nginx/LuaJIT-based FL1, specifically memory safety issues and data races. At Cloudflare’s immense scale, these guarantees aren’t merely desirable; they are essential. Every microsecond shaved off request processing translates directly into a better user experience, and preventing crashes ensures the continued stability of the internet ecosystem.
The decision to rewrite core logic in Rust wasn’t taken lightly. Recognizing the disruption of asking teams to maintain parallel codebases, Cloudflare implemented a clever transitional layer within the existing FL1 system. This allowed developers to implement new modules in Rust and seamlessly replace their Lua counterparts, avoiding a prolonged period of dual maintenance. Over 100 engineers collaborated on FL2, undertaking rigorous testing and establishing a fallback procedure to FL1 for maximum reliability.
Early customer traffic was routed through FL2 in early 2025, with the percentage steadily increasing throughout the year. The results, validated by both internal tools and independent benchmarks like CDNPerf, demonstrate a clear and measurable improvement in website responsiveness.
From Complexity to Simplicity: The Architectural Shift
The performance gains aren’t solely attributable to the language choice. FL2’s architecture is fundamentally more efficient than its predecessor. FL2 performs less work overall, thanks to intelligent filters that determine which modules need to be executed for each request. Furthermore, FL2 is a unified codebase, built in a performance-focused language. In contrast, FL1 relied on a complex combination of Nginx (written in C), LuaJIT (Lua and C interface layers), and even existing Rust modules.
This multi-language approach in FL1 necessitated constant data conversion between different representations, consuming significant CPU and memory resources. Internal measurements reveal that FL2 utilizes less than half the CPU and significantly less than half the memory of FL1. This freed-up capacity allows Cloudflare to deliver even more features and functionality to its customers.
Did You Know?
FL2’s modular architecture, coupled with Rust’s strict compile-time guarantees, fosters a high degree of confidence in code changes. Cloudflare maintains a zero-tolerance policy for unexplained system crashes, and the reduced crash rate observed with FL2 allows engineers to focus on proactive improvements rather than reactive firefighting.
The migration from FL1 to FL2 is expected to be completed throughout 2025, with FL1 being decommissioned in early 2026. Cloudflare anticipates that the benefits – improved customer performance and accelerated development velocity – will continue to accrue as the new system matures.
What impact will this performance boost have on emerging technologies like WebAssembly and serverless functions? And how will Cloudflare leverage its new infrastructure to further innovate in the realm of edge computing?
Looking Ahead: Optimization and Innovation
With the foundational work of FL2 complete, Cloudflare is poised to enter a new phase of optimization and innovation. The modular, Rust-based architecture provides a solid platform for continuous improvement and the rapid deployment of new features. The company is already exploring advanced optimization techniques, leveraging the efficiency gains to deliver even greater value to its customers.
Cloudflare’s commitment to Rust and its investment in a modern infrastructure demonstrate a forward-thinking approach to tackling the challenges of a rapidly evolving internet landscape. This upgrade isn’t just about speed; it’s about building a more reliable, secure, and scalable foundation for the future of the web.
Pro Tip:
Frequently Asked Questions
What is the primary benefit of Cloudflare’s FL2 system?
The primary benefit of FL2 is a significant improvement in network performance, with a median latency reduction of 10 milliseconds and a 25% performance boost as measured by CDN performance tests.
What role does the Rust programming language play in FL2?
Rust is the foundation of FL2, built upon Cloudflare’s Oxy framework. It eliminates common bugs like memory safety issues and data races, while delivering C-level performance.
How did Cloudflare manage the transition from FL1 to FL2?
Cloudflare implemented a transitional layer within FL1, allowing developers to write new modules in Rust and replace existing Lua logic without waiting for a complete system overhaul.
What is Oxy, and why is it important?
Oxy is Cloudflare’s next-generation proxy framework, built entirely in Rust. It provides a secure and efficient foundation for FL2, enabling significant performance and security improvements.
When will Cloudflare completely decommission the FL1 system?
Cloudflare plans to complete the migration from FL1 to FL2 throughout 2025 and decommission FL1 in early 2026.
Share this article with your network to spread the word about Cloudflare’s groundbreaking performance improvements! Join the discussion in the comments below – what are your thoughts on the impact of Rust on modern infrastructure?
Discover more from Archyworldys
Subscribe to get the latest posts sent to your email.