Giter Club home page Giter Club logo

ehttpd-rust's Introduction

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

ehttpd

Welcome to ehttpd ๐ŸŽ‰

ehttpd is a thread-based HTTP server library, which can be used to create custom HTTP server applications.

Thread-based design

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 since the developer cannot accidentally stall the entire runtime with a single blocking call โ€“ managed by the OS-scheduler, threads offer much stronger concurrency isolation guarantees (which can even be niced or tweaked in most environments if desired).

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, helloworld, v0.7.1)

$ 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     1.00ms  520.00us  27.29ms   95.96%
    Req/Sec     1.02k   262.37     6.00k    94.81%
  654074 requests in 10.10s, 32.44MB read
Requests/sec:  64756.19
Transfer/sec:      3.21MB

Old Linux Machine (Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz, helloworld-nokeepalive, v0.7.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     2.22ms    1.00ms  60.93ms   95.30%
    Req/Sec   435.19     56.94     1.00k    85.05%
  278046 requests in 10.10s, 18.83MB read
Requests/sec:  27528.42
Transfer/sec:      1.86MB

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.