Skip to content

fish2016/network_performance_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

介绍

此项目为测试http网络程序的性能,初始代码克隆自项目zap的wrk目录

原项目,支持对zip、go、rust等网络框架性能测试,在此基础上,计划加上对fasthttp、gnet等网络框架的性能测试

开始

准备工作

安装wrk

sudo apt update
sudo apt install build-essential libssl-dev git
git clone https://github.com/wg/wrk.git
cd wrk
make
sudo cp wrk /usr/local/bin/
wrk --version

安装编译、运行环境

请根据测试的项目,自行安装go、rust、zig等编译环境

TODO: 原项目支持在shell.nix隔离环境运行测试程序,但本项目未移此功能过来

配置脚本权限

chmod 755 ./wrk/measure.sh
chmod 755 ./wrk/measure_all.sh

单项测试

第二个参数为测试对象:

可选参数为: zig-zap go python python-sanic rust-bythebook rust-bythebook-improved rust-clean rust-axum csharp cpp-beast

./wrk/measure.sh go

全部测试

启动测试wrk目录下的所有测试对象

./wrk/measure_all.sh

输出统计图表

./wrk/measure_all.sh //需要先执行一遍全量性能测试(会产生测试xxx.perlog文件,graph.py会根据perlog文件输出图表)

python3 ./wrk/graph.py

测试报告

设备1

硬件信息

========== CPU Info ==========

Model name: Intel(R) Core(TM) i5-10200H CPU @ 2.40GHz

Thread(s) per core: 2

Core(s) per socket: 4

Socket(s): 1

========== Memory Info ==========

23GB RAM

性能报告

req_per_sec xfer_per_sec avg_delay

About

http performance for go\rust\cpp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published