Giter VIP home page Giter VIP logo

rewrk's Introduction

rewrk

A more modern http framework benchmark utility.

F:\rewrk> rewrk -h http://127.0.0.1:5000 -t 12 -c 60 -d 5s

Benchmarking 60 connections @ http://127.0.0.1:5000 for 5 seconds
  Latencies:
    Avg      Stdev    Min      Max    
    3.27ms   0.40ms   1.95ms   9.39ms
  Requests:
    Total:  91281  Req/Sec: 18227.81
  Transfer:
    Total: 1.13 MB Transfer Rate: 231.41 KB/Sec

With optional --pct flag

+ --------------- + --------------- +
|   Percentile    |   Avg Latency   |
+ --------------- + --------------- +
|      99.9%      |     6.88ms      |
|       99%       |     5.62ms      |
|       95%       |     4.62ms      |
|       90%       |     4.24ms      |
|       75%       |     3.78ms      |
|       50%       |     3.49ms      |
+ --------------- + --------------- +

Motivation

The motivation behind this project extends from developers tunnel visioning on benchmarks like techempower that use the benchmarking tool called wrk.

The issue is that wrk only handle some of the HTTP spec and is entirely biased towards frameworks and servers that can make heavy use of HTTP/1 Pipelining which is no longer enabled in most modern browsers or clients, this can give a very unfair and unreasonable set of stats when comparing frameworks as those at the top are simply better at using a process which is now not used greatly.

This is where rewrk comes in, this benchmarker is built on top of hyper's client api and brings with it many advantages and more realistic methods of benchmarking.

Current features

  • Supports both HTTP/1 and HTTP/2.
  • Pipelining is disabled giving a more realistic idea on actual performance.
  • Multi-Platform support, developed on Windows but will run on Mac and Linux as well.

To do list

  • Add a random artificial delay benchmark to simulate random latency with clients.
  • Arithmetic benchmark to simulate different loads across clients.
  • State checking, making the frameworks and servers use all of their API rather than a minimised set.
  • JSON deserialization and validation benchmarks and checking.
  • Truly concurrent HTTP/2 benchmark.

Usage

Usage is relatively simple, if you have a compiled binary simply run using the CLI.

Example

Here's an example to produce the following benchmark:

  • 256 connections (-c 256)
  • HTTP/2 only (--http2)
  • 12 threads (-t 12)
  • 15 seconds (-d 15s)
  • with percentile table (--pct)
  • on host http://127.0.0.1:5000 (-h http://127.0.0.1:5000)

CLI command:
rewrk -c 256 -t 12 -d 15s -h http://127.0.0.1:5000 --http2 --pct

CLI Help

To bring up the help menu simply run rewrk --help to produce this:

USAGE:
    rewrk.exe [FLAGS] [OPTIONS] --duration <duration> --host <host>

FLAGS:
        --help       Prints help information
        --http2      Set the client to use http2 only. (default is http/1) e.g. '--http2'
        --pct        Displays the percentile table after benchmarking.
    -V, --version    Prints version information

OPTIONS:
    -c, --connections <connections>    Set the amount of concurrent e.g. '-c 512' [default: 1]
    -d, --duration <duration>          Set the duration of the benchmark.
    -h, --host <host>                  Set the host to bench e.g. '-h http://127.0.0.1:5050'
    -t, --threads <threads>            Set the amount of threads to use e.g. '-t 12' [default: 1]

Building from source

Building from source is incredibly simple, just make sure you have a stable version of Rust installed before you start.

With Cargo Install

    • Run cargo install rewrk --git https://github.com/ChillFish8/rewrk.git

With Cargo Run

    • Clone the repo source code
    • Run cargo run --release -- <enter flags here>

With Cargo Build

    • Clone the repo source code
    • Run cargo build --release
    • Extract the binary from the release folder
    • Binary ready to use.

rewrk's People

Contributors

awulkan avatar chillfish8 avatar davidpdrsn avatar finnbear avatar ishtms avatar programatik29 avatar robjtede avatar

Stargazers

 avatar  avatar

Forkers

smilexth kunrabil

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.