π Building low-latency web apps in C++23: Meet CETAN, a Linux web application server with native TLS & integrated AI threat detection
We are finally ready to share CETANβa dedicated C++ web application server designed specifically for Linux environments where latency, granular control, and tight security are non-negotiable.
If you are building latency-sensitive RESTful services or hosting dynamic C++ services alongside static content, we wanted to create something that feels cohesive rather than stitching together multiple external libraries.
β‘ Benchmark Performance (Old Hardware Test)
Instead of running benchmarks on massive, expensive cloud instances, we wanted to see how CETAN handles fully dynamic routing under pressure on standard, older desktop hardware.
Test Machine: Intel Core i5 (4th Generation), 4 cores, 16GB RAM (performance should scale significantly higher on modern CPUs).
Endpoint Tested: A /ping URL hosted directly from the application root to force a full dynamic routing lookup.
Test Command: wrk -t8 -c400 -d30s https://cetan.io
Note on Setup: The built-in Web Guard AI component was disabled during this run to establish a clean framework baseline.
The Results (30-second sustained load):
Concurrency: 8 threads handling 400 active connections
Throughput: 31,071.93 Requests/sec
Data Transfer: 3.76 MB/sec
Latency Profile:
Average: 12.88 ms
Standard Deviation: 3.37 ms
Max Latency: 132.66 ms
π οΈ The Tech Stack & Requirements
Language/Standard: Built using modern C++23.
Environment: Linux-first runtime (requires GLIBC++ β₯ GLIBCXX_3.4.33 and a modern compiler like g++ 14).
Configuration: Simple centralized configuration using standard XML (cetan_config.xml).
π§ Built-in AI Security: Web Guard
One of the unique things we integrated directly into the core server layer is CETAN AI β Web Guard. Instead of relying entirely on heavy external WAFs, Web Guard uses a lightweight, low-latency transformer model to inspect every single incoming HTTP request in real time. It instantly classifies traffic as normal, suspicious, or scannerβcatching tools like sqlmap, wpscan, or custom fuzzers before they even hit your application endpoints.
π» Hello World Example
Writing a microservice using the CETAN REST API looks like this:
// Greeting service β /rest-101/greeting/hello-world
class Greeting : public WebService {
public:
Greeting() : WebService("/greeting") {}
Response hello_world() {
Response resp(200);
resp.body("Hello, World!");
return resp;
}
private:
std::vector register_resources() const override {
std::vector resources;
resources.emplace_back(new Resource("GET", "/hello-world", &Greeting::hello_world));
return resources;
}
};
π Core Platform Features
Structured Logging (SLog): Rather than bringing in external logging systems, we package the native SLog subsystem into the runtime framework. It handles thread-safe structured logging out of the box so you can maintain granular execution traces without sacrificing throughput.
Integrated JSON Handling: Building modern endpoints shouldn't require configuring third-party serialization libraries. The runtime ships with a fully optimized, compiled JSON / XML RESTful parsing stack integrated directly into the SDK.
Safe Secrets Management: We built a secondary utility called Safe to store your TLS keys, passwords, and tokens in encrypted .safe files. You just reference the encrypted entry keys in your server config so nothing is ever hardcoded.
Native Security: Native support for TLS/HTTPS, IP filtering (CIDR white/blacklisting), and Basic/Bearer/LDAP authentication out of the box.
Container Ready: It can run bare-metal or inside micro-containers via our prebuilt Docker images.
π How to Try It
If you want to poke around the documentation, test out the interactive Web Guard traffic classification tester, or grab the REST API SDK to build a sample endpoint, check us out at cetan.io.
We are looking for brutal, honest engineering feedback. How do you handle your C++ web server routing today? Are there specific edge-case integrations or benchmarks you would want to see next?
Let us know your thoughts!
Top comments (0)