Benchmarking web frameworks written in rust with rewrk tool.

Overview

Web Framework Benchmarks

Benchmarking web frameworks written in rust with rewrk tool.

Bench

Clone and compile rewrk:

git clone https://github.com/ChillFish8/rewrk
cd rewrk/
cargo build --release
cd target/release/

Open a new tab in rust-web-benchmarks directory, compile and run desired server. Example:

cd frameworks/

cargo run --release --bin=hyper-hello-world

# In rewrk tab
echo "Results for hyper:" && ./rewrk -t 12 -c 500 -d 10s -h http://localhost:3000/

# Back to frameworks tab
cargo run --release --bin=axum-hello-world

# In rewrk tab
echo "Results for axum:" && ./rewrk -t 12 -c 500 -d 10s -h http://localhost:3000/

Benchmark Types

Hello World

Server responds Hello, world! to every request.

Available low-level frameworks:

Available high-level frameworks:

See results.

Comments
  • Show the benchmark result with table?

    Show the benchmark result with table?

    Background

    It would be nice if there is a table showing the result of the benchmark between each web framework.

    Expectation

    It is something like that:

    | framework | Latencies.Avg | ... | Requests.Total | ... | Transfer.Total | ... | Maximum Memory Usage | | -- | -- | -- | -- | -- | -- | -- | -- | | actix-web | 0.50ms | ... | 30178057 | ... | 3.65 GB | .. | 13.7 MB | | ... |

    Anything else

    I am willing to add this feature.

    opened by lexcao 6
  • Failed to test on Mac systems

    Failed to test on Mac systems

    osinfo:

    ProductName: macOS ProductVersion: 11.5.2 BuildVersion: 20G95

    kern.maxfilesperproc: 49152 kern.maxfiles: 98304

    result:

    ➜ echo "Results for hyper:" && rewrk -t 12 -c 300 -d 10s -h http://localhost:3000/

    Results for hyper: Beginning round 1... Benchmarking 300 connections @ http://localhost:3000/ for 10 second(s) failed to run benchmark round due to error: error combining results: connection closed

    use wrk it's ok:

    ➜ wrk -t12 -c400 -d30s --latency http://localhost:3000/ wrk http://localhost:3000/ Running 30s test @ http://localhost:3000/ 12 threads and 400 connections Thread Stats Avg Stdev Max +/- Stdev Latency 808.44us 247.22us 3.95ms 72.97% Req/Sec 23.51k 9.67k 141.20k 79.11% Latency Distribution 50% 819.00us 75% 0.96ms 90% 1.10ms 99% 1.40ms 7020424 requests in 30.10s, 589.18MB read Socket errors: connect 157, read 89, write 0, timeout 0 Requests/sec: 233235.83 Transfer/sec: 19.57MB

    opened by ecafkoob 5
  • Add explanation to benchmarks results

    Add explanation to benchmarks results

    It would help newbies if some explanation is added to benchmarks results like lower is better or higher is better. I think this explanation should be printed by rewrk by defualt.

    opened by shujaatak 3
  • Add csv table formatted benchmark and results

    Add csv table formatted benchmark and results

    I just wanted to be able to more easily compare the results between frameworks, so I made a pretty printed monospaced table with the benchmark results, so the results align vertically and you can see exactly the difference between frameworks.

    Depends on pq and csvkit that were available in mac homebrew for me at least.

    opened by samal-rasmussen 1
  • add actix-web example

    add actix-web example

    benchmark with my MBP(rewrk with -c 100) the results:

    $ echo "Results for hyper:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
    Results for hyper:
    Beginning round 1...
    Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
      Latencies:
        Avg      Stdev    Min      Max
        1.28ms   0.90ms   0.07ms   9.99ms
      Requests:
        Total: 774594  Req/Sec: 77440.91
      Transfer:
        Total: 65.01 MB Transfer Rate: 6.50 MB/Sec
    
    
    $ echo "Results for axum:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
    Results for axum:
    Beginning round 1...
    Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
      Latencies:
        Avg      Stdev    Min      Max
        1.27ms   0.80ms   0.08ms   8.55ms
      Requests:
        Total: 780470  Req/Sec: 78041.91
      Transfer:
        Total: 66.24 MB Transfer Rate: 6.62 MB/Sec
    
    
    $ echo "Results for actix-web:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
    Results for actix-web:
    Beginning round 1...
    Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
      Latencies:
        Avg      Stdev    Min      Max
        1.55ms   1.82ms   0.07ms   14.54ms
      Requests:
        Total: 642066  Req/Sec: 64173.35
      Transfer:
        Total: 79.60 MB Transfer Rate: 7.96 MB/Sec
    
    opened by smallfish 1
Owner
null
A boilerplate++ for a minimal rust web backend

Boiler room A boilerplate++ for a minimal rust web backend Just fork/clone/download this repo and build your backend on it. Why? Both routing and erro

null 3 Nov 28, 2022
simple lottery maker made with rust, just web framework

Toy project for fun It's just for fun! making plausible lottery numbers for Korea made with rust This lottery web framework generates and presents pla

yacho (bakjuna) 4 Nov 24, 2023
A cog-like tool, written in Rust.

Corg A cog-like tool, written in Rust. The primary difference between Cog and Corg is how Corg executes code blocks. Being written in Rust, it cannot

null 1 Jan 19, 2022
Web Browser Engineering

This is a port of Web Browser Engineering series from Python to Rust done by Korean Rust User Group.

한국 러스트 사용자 그룹 36 Dec 12, 2022
Blueboat is an open-source alternative to Cloudflare Workers. The monolithic engine for serverless web apps.

Blueboat Blueboat is an open-source alternative to Cloudflare Workers. Blueboat aims to be a developer-friendly, multi-tenant platform for serverless

Heyang Zhou 1.8k Jan 9, 2023
Web service for Firefox Suggest

Merino A service to provide address bar suggestions to Firefox. For more details, see the service docs. About the Name This project drives an importan

Mozilla Services 27 Sep 23, 2022
Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller

slidershim Software adapter for various Chunithm slider controllers with a built-in Brokenithm web controller. Has support for keyboard/gamepad output

Si Yuan 45 Dec 17, 2022
Web service generating images of Japanese (Riichi) Mahjong hands.

chombo-gen ChomboGen is a web service that allows to generate images of Japanese (Riichi) Mahjong hands. The hands are provided in a text format and a

Mateusz Maćkowski 5 May 2, 2023
Blazingly fast spam classification API built using Rocket Web Framework.

Telegram Antispam API Blazingly fast spam classification API built using Rocket Web Framework. Notes The classifier works in aggressive mode, it can s

Akshay Rajput 13 May 5, 2023
Memory.lol - a tiny web service that provides historical information about social media accounts

memory.lol Overview This project is a tiny web service that provides historical information about social media accounts. It can currently be used to l

Travis Brown 317 Jul 12, 2023
🚀 Fleet is the blazing fast build tool for Rust

Fleet is the blazing fast build tool for Rust. Compiling with Fleet is up-to 5x faster than with cargo.

Dimension 2.2k Jan 6, 2023
A Modern, Lightweight HTTP Learning Tool in Rust

Toy-HTTP-rs: A Modern, Lightweight HTTP Learning Tool in Rust Welcome to toy-http-rs! This is a hands-on, educational project designed to provide an a

null 12 May 27, 2023
🛠️ | System tool for all my lovers

<<<<<<< HEAD ?? love-fetch Original code ferris-fetch ?? ??️ System tool for all my lovers ?? How to install it ?? cargo install love-fetch License ??

Fabio Grimaldi 11 Jun 13, 2021
Tool to make Solus packaging even easier.

A small tool to make packaging for Solus even easier. Features Remove all packages from the local solbuild repo.

null 5 Oct 19, 2022
A library and tool for automata and formal languages, inspired by JFLAP

Sugarcubes is a library and application for automata and formal languages. It is inspired by JFLAP, and is intended to eventually to be an alternative to JFLAP.

Henry Sloan 22 Nov 2, 2022
Schema2000 is a tool that parses exsiting JSON documents and tries to derive a JSON schema from these documents.

Schema 2000 Schema2000 is a tool that parses exsiting JSON documents and tries to derive a JSON schema from these documents. Currently, Schema2000 is

REWE Digital GmbH 12 Dec 6, 2022
Lightweight tool for simple deployment (server+client)

deploy Lightweight tool for simple deployment (server+client) Usage You first need a key value pair: deploy generate-keys Public-Key: Used on the serv

Jan-Mirko Otter 0 Dec 27, 2021
CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" format.

Lighthouse Groupie CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" form

Polestar 1 Jan 12, 2022
A crude tool to convert from Bitwarden json format to lastpass

Pass-Merger A crude tool to convert from Bitwarden json format to lastpass. Steps to Deduplicate entries from Bitwarden Export all passwords from Chro

Usairim Isani 1 Jan 20, 2022