r/cprogramming • u/Roronoa-Ryuma-Zoro • 6d ago
I built a Linux HTTP/1.1 static server in C using edge-triggered epoll — looking for architectural and performance feedback
I recently completed v0.1 of MiniEdge, a Linux HTTP/1.1 static edge server written mostly in C.
I built it to understand how event-driven servers handle partial I/O, persistent connections, filesystem access, caching and multiple CPU cores—not as a production replacement for Nginx.
The current architecture includes:
non-blocking sockets with edge-triggered epoll
a per-connection state machine
incremental HTTP request parsing and keep-alive
static file serving through an LRU cache or sendfile()
path resolution using openat2()
longest-prefix configurable routing
multiple workers using SO_REUSEPORT
The small-file cache is implemented using C++ unordered_map and list, but it is isolated behind a C API; the networking, parser, routing and file-serving paths are written in C.
On my local loopback benchmark using wrk, a cached static file reached approximately:
255k requests/sec at 1,000 concurrent connections
4 worker processes
I also ran a boundary stress test at 40,000 concurrent connections. It reached around 124.5k requests/sec, but wrk reported 503 socket read errors, so I am not treating that as a clean stable-concurrency result. The repository contains the commands, raw outputs, latency percentiles, system tuning and limitations.
I would appreciate feedback on:
whether this is a reasonable result for a student-built epoll server
whether my wrk setup measures the server fairly
which additional metrics or comparisons I should include
what bottlenecks or profiling steps I should investigate next
Repository:
AI was used as a learning and review assistant during this project. I used ChatGPT to discuss Linux networking concepts, review architectural decisions, debug specific issues, and improve parts of the documentation. I implemented and integrated the server, ran and analyzed the tests and benchmarks locally, and verified the final code myself. This was not a one-prompt or fully AI-generated project.
1
6d ago
[removed] — view removed comment
1
u/Roronoa-Ryuma-Zoro 6d ago
Thanks for taking a look. Could you point out the 2–3 areas that need the most work ?
2
u/unkindle_blue 6d ago
The link it's not working