Skip to content

Improve HTTPServer performance #2

@mneumann

Description

@mneumann

A hello world server with Rust (warp) gives:

> wrk -c 1 -t 1 -d 10s --latency http://127.0.0.1:8080/
Running 10s test @ http://127.0.0.1:8080/
  1 threads and 1 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    36.33us    8.49us   0.88ms   95.58%
    Req/Sec    26.40k     2.12k   27.87k    82.18%
  Latency Distribution
     50%   34.00us
     75%   36.00us
     90%   43.00us
     99%   53.00us
  265337 requests in 10.10s, 32.39MB read
Requests/sec:  26272.04
Transfer/sec:      3.21MB

While the same benchmark with the Savi HTTP server example from examples/http:

> wrk -c 1 -t 1 -d 10s --latency http://127.0.0.1:8080/
Running 10s test @ http://127.0.0.1:8080/
  1 threads and 1 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    98.77us    1.27ms  25.76ms   99.76%
    Req/Sec     4.01k     0.00     4.01k   100.00%
  Latency Distribution
     50%   35.00us
     75%   39.00us
     90%   43.00us
     99%   57.00us
  409 requests in 10.13s, 16.38KB read
Requests/sec:     40.37
Transfer/sec:      1.62KB

Figure out where the problem is. Note that Savi can sustain 40k req/sec when running wrk with 1000 connections. But there clearly is an issue with the throughput of a single connection. Tested on FreeBSD.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions