Cloudflare Outlines How They Rewrote An Nginx C Module In Rust

Written by Michael Larabel in Linux Networking on 26 February 2023 at 07:28 AM EST. 37 Comments
LINUX NETWORKING
While Cloudflare is in the process of replacing Nginx with their in-house, Rust-written alternative, the Cloudflare infrastructure is vast and has many different services at play. For one of the areas they are still currently relying on Nginx, this week they published a blog post outlining how they rewrote an Nginx module in the C programming language to instead make use of Rust.

Cloudflare engineers continue loving Rust and making use of it throughout their infrastructure for memory safety benefits, more modern features, and other advantages. Cloudflare engineers have no issues publicly professing their love for Rust.

Cloudflare logo


Cloudflare published a blog post on rewriting an Nginx module in Rust to help those with C modules for Nginx that may be interested in transitioning them to this more memory safe programming language. Check out that post for all the technical details as well as going over the challenges encountered.

The post also notes they are hiring more Rust engineers and also talked up Rust benefits for them as:
"Safety in programming languages is often seen as beneficial in terms of preventing bugs, but as a company we’ve found that it also allows you to do things which would be considered very hard, or otherwise impossible to do safely. Whether it be providing a Wireshark-like filter language for writing firewall rules, allowing millions of users to write arbitrary JavaScript code and run it directly on our platform or rewriting HTML responses on the fly, having strict boundaries in place allows us to provide services we wouldn’t be able to otherwise, all while safe in the knowledge that the kind of memory-safety issues that used to plague the industry are increasingly a thing of the past."
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week