Rust for Apache modules?


Hi all, first post on here - thanks for having me :slight_smile:

I’m working on a project to redevelop a legacy web service. Its quite a high traffic application and growing in use, so performance is a major focus.

I’m a recent convert to Rust and very impressed so far. It occurred to me that rewriting our application in Rust as an Apache module could be a good solution.

I am aware that faster web server platforms are available and I may end up going down that route. Firstly though I would like to explore the Apache module approach (because we know Apache well and it is super stable).

Has anyone out there done this? Any pitfalls I need to know about?

Thanks in advance



I’m not aware of any work in this area (but I also haven’t looked). Apache uses it’s own set of C libraries called the Apache Portable Runtime (APR). I don’t know to what extent the primitives in there are compatible with Rust, especially w.r.t. I/O and synchronization. You will still be able to use Rust of course, but you might need to avoid using anything from the std::fs, std::net, std::thread and std::sync modules (but std::sync::{atomic, Arc} should be OK).



Thanks very much jethrogb