CentOS 下性能測試工具 wrk 安裝

前言:

使用 ab 工具無法壓測到性能極限時,就可以使用 wrk 來壓測,但 wrk 只支持 linux,因此本文記錄一下安裝過程。

1、安裝 Git:

yum install git

2、下載 wrk:

git clone https://github.com/wg/wrk.git

3、安裝工具:

yum install unzip

4、安裝編繹工具:

yum install gcc

5、編繹 make

git 下載的目錄默認在 /root/wrk 下,先切換目錄:

cd wrk

運行編繹命令:

make

如果出錯,根據錯誤信息互聯網搜索一下,如果正常,進行下一步。

6、鏈接 或 複製到 /bin 目錄

ln wrk /usr/local/bin

或者:

cp wrk /usr/local/bin

7、測試運行:

如,運行命令:

wrk -t 1 -c 2 -d 10s https://www.baidu.com

得到以下壓測結果:

Running 10s test @ https://www.baidu.com
  1 threads and 2 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    52.69ms   37.80ms 454.50ms   97.09%
    Req/Sec    40.36      9.57    60.00     59.18%
  401 requests in 10.01s, 4.02MB read
Requests/sec:     40.05
Transfer/sec:    410.64KB

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章