Add Ulfius: C REST framework on GNU Libmicrohttpd (first C app framework!)#26
Add Ulfius: C REST framework on GNU Libmicrohttpd (first C app framework!)#26MDA2AV merged 4 commits intoMDA2AV:mainfrom
Conversation
yder's CMake requires libsystemd-dev for journald logging, which isn't available in minimal Docker builds. Disable it with -DWITH_JOURNALD=OFF since we only need yder as a dependency for ulfius, not its journald features.
|
Build fix: yder (logging library dependency) requires Added |
- Include zlib.h and link -lz - Pre-compress large JSON at startup with deflateInit2 (gzip mode) - Serve gzipped response when Accept-Encoding includes gzip - Add zlib1g to runtime image
libmicrohttpd is HTTP/1.1 only. Removed baseline-h2 and static-h2 from tests list since they can't pass.
|
CI fix: removed libmicrohttpd is HTTP/1.1 only — no HTTP/2 support. The H2 tests were incorrectly included and caused 4 test failures (H2 negotiation + missing Content-Type over H2). All HTTP/1.1 tests (22/22) passed clean ✅ |
Benchmark ResultsFramework: Full log |
|
Ulfius benchmarks are in! 🎉 Solid showing for a C REST framework built on GNU Libmicrohttpd: 🚀 Pipelined: 1.27M req/s at 16384c — impressive that it actually scales up with more connections. MHD's thread pool + internal epoll handling this well. The limited-conn numbers (176K) suggest MHD's thread pool has some per-connection overhead on connection churn — makes sense given it's managing internal connection state. Upload at ~800 req/s is on par with other entries for the 20MB profile. The memory spike to 15.8GB at 512c suggests MHD buffers the full body per-thread — could be tunable but works fine. Ready for merge! 🚀 |
Ulfius — Pure C REST Framework
Ulfius is a lightweight HTTP framework for building REST APIs in pure C. Built on GNU Libmicrohttpd with Jansson for JSON, it's designed for embedded systems and apps where memory footprint matters.
Why add it?
Implementation
-O3 -flto -march=nativeTests enabled
baseline, noisy, pipelined, limited-conn, json, upload, compression, mixed, baseline-h2, static-h2
cc @babelouest — thought it'd be cool to see how Ulfius stacks up against other frameworks in HttpArena! Pure C with libmicrohttpd is a really interesting combination for benchmarks 🔧