GithubHelp home page GithubHelp logo

hakusai22 / hertz-benchmark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudwego/hertz-benchmark

0.0 0.0 0.0 1.71 MB

Tracking performance changes for Hertz

Shell 7.84% Python 8.36% Lua 1.79% Go 82.01%

hertz-benchmark's Introduction

Hertz-Benchmark

English | δΈ­ζ–‡

After researching other projects' benchmarks and HTTP usage scenarios, we believe that the Echo scenario can reflect real usage scenarios. This project provides performance records for several HTTP frameworks in the Echo scenario.

Instructions

Local testing

Please make sure to meet the environment requirements before executing.

Server

./scripts/benchmark_server.sh

Client

./scripts/benchmark_client.sh

Profiling

Since the default test parameters will complete a test quickly, to get a longer data collection time, you can manually adjust the test parameter n size in ./scripts/benchmark_server.sh.

Profiling Server

Refer to the corresponding script for the port mapping of different servers, e.g.:

cat ./scripts/benchmark_pb.sh

# ...
repo=("hertz" "fasthttp" "gin" "fasthttp_timeout")
ports=(8000 8001 8002 8003 8004)

After obtaining the corresponding server port, execute:

go tool pprof localhost:{port}/debug/pprof/{pprof_type}

You can also use wrk as the load generator, refer to the following command.

./scripts/benchmark_wrk.sh

# parse data
# ${input_file} locates in /output/$(date +%F-%H-%M).log
# specify one ${output_file}
python ./scripts/wrk/parse_data.py ${input_file} ${output_file} 

# render images
python ./scripts/reports/render_images.py ${output_file}

You can also use ab as the load generator, refer to the following command.

./scripts/benchmark_ab.sh

# parse data
# ${input_log_file} locates in /output/$(date +%F-%H-%M).log
# ${input_latency_file} folder locates in /output/latency_$(date +%F-%H-%M)
# specify one ${output_file}
python ./scripts/ab/parse_data.py ${input_log_file} ${input_latency_file} ${output_file} 

# render images (ab does not provide tp999)
python ./scripts/reports/render_images.py ${output_file}

Environment Requirements

  • OS: Linux
    • The script depends on the taskset command to limit the CPUs used by the client and server. If executing on other systems, please modify the script accordingly.
  • CPU: Recommended configuration is >=20 cores, minimum requirement is >=4 cores
    • The default test script requires a 20-core CPU, which can be modified or removed in the taskset -c ... part of the script.

Reference Data

Remarks:

The test data is obtained by filling the server with adequate machine resources, and therefore focuses more on server performance. Caller performance data will be provided in the future.

Configuration

  • CPU: AMD EPYC 7Y83 64-Core Processor 2.7GHz
    • server limited to 4-CPUs, client limited to 16-CPUS
  • OS: Debian GNU/Linux 10 (buster)
  • Go 1.19

Data (Echo, 100 concurrency, 1k Header)

  • Comparison of four frameworks Performance
  • Comparison of three frameworks Performance

hertz-benchmark's People

Contributors

duslia avatar fgyffff avatar purewhitewu avatar dependabot[bot] avatar ppzqh avatar

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.