#web-server #applications-server #create #default #thread-based #rationale

ehttpd

A HTTP server nano-framework, which can be used to create custom HTTP server applications

25 releases (12 breaking)

Uses new Rust 2024

new 0.13.2 May 12, 2026
0.13.1 Mar 28, 2026
0.12.0 Mar 27, 2026
0.11.0 Dec 1, 2025
0.4.3 Mar 20, 2023

#269 in HTTP server

Download history 14/week @ 2026-01-14 22/week @ 2026-01-21 19/week @ 2026-01-28 15/week @ 2026-02-04 14/week @ 2026-02-11 20/week @ 2026-02-18 15/week @ 2026-02-25 18/week @ 2026-03-04 23/week @ 2026-03-11 18/week @ 2026-03-18 67/week @ 2026-03-25 46/week @ 2026-04-01 45/week @ 2026-04-08 17/week @ 2026-04-15 7/week @ 2026-04-22 1/week @ 2026-04-29

72 downloads per month
Used in 3 crates

BSD-2-Clause OR MIT

49KB
959 lines

License BSD-2-Clause License MIT AppVeyor CI docs.rs crates.io Download numbers dependency status

ehttpd

Welcome to ehttpd 🎉

ehttpd is a HTTP server library, which can be used to create custom HTTP server applications. It also offers an optional threadpool-based server for simple applications (feature: server, disabled by default).

Threadpool-based server

The rationale behind the thread-based approach is that it is much easier to implement than async/await, subsequently requires less code, and is – in theory – less error prone.

Furthermore, it also simplifies application development as the developer cannot accidentally stall the entire runtime with a single blocking call. Since threads are managed and preempted by the OS-scheduler, they offer much stronger concurrency guarantees, and are usually more resilient against optimization issues or bugs.

Performance

While the thread-based approach is not the most efficient out there, it's not that bad either. Some wrk benchmarks:

MacBook Pro (M1 Pro, v0.12.0)

$ wrk -t 64 -c 64 http://localhost:9999/testolope
Running 10s test @ http://localhost:9999/testolope
  64 threads and 64 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.85ms   85.72us   6.62ms   92.48%
    Req/Sec     1.17k    28.34     1.25k    87.08%
  754610 requests in 10.10s, 37.42MB read
Requests/sec:  74713.82
Transfer/sec:      3.71MB

$ wrk -t 64 -c 64 http://localhost:9999/testolope-nokeepalive
Running 10s test @ http://localhost:9999/testolope-nokeepalive
  64 threads and 64 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.96ms    4.81ms  89.48ms   98.57%
    Req/Sec   303.72     62.34   353.00     90.42%
  117823 requests in 10.06s, 7.98MB read
  Socket errors: connect 64, read 0, write 0, timeout 0
Requests/sec:  11716.92
Transfer/sec:    812.40KB

Linux Machine (Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz, v0.12.0)

$ wrk -t 64 -c 64 http://localhost:9999/testolope
Running 10s test @ http://localhost:9999/testolope
  64 threads and 64 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   188.08us  177.57us  12.10ms   90.95%
    Req/Sec     5.93k     1.03k   10.34k    77.99%
  3815863 requests in 10.10s, 189.23MB read
Requests/sec: 377809.30
Transfer/sec:     18.74MB

$ wrk -t 64 -c 64 http://localhost:9999/testolope-nokeepalive
Running 10s test @ http://localhost:9999/testolope-nokeepalive
  64 threads and 64 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   611.05us  225.83us   9.18ms   76.85%
    Req/Sec     1.48k    75.48     2.11k    76.26%
  951970 requests in 10.10s, 64.46MB read
Requests/sec:  94255.61
Transfer/sec:      6.38MB

Dependencies

~44KB