Http压测工具 wrk

Http压测工具 wrk

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

wrk支持大多数类UNIX系统,不支持windows。需要操作系统支持LuaJIT和OpenSS

install

git 下载

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

make 

源码

wget https://github.com/wg/wrk/archive/4.1.0.zip

unzip 4.1.0.zip && cd wrk-4.1.0 && make

默认情况下wrk会使用自带的LuaJIT和OpenSSL,如果你想使用系统已安装的版本,可以使用WITH_LUAJIT和WITH_OPENSSL这两个选项来指定它们的路径。比如:

make WITH_LUAJIT=/usr/local/luajit WITH_OPENSSL=/usr/local/openssl

基本使用

Usage: wrk <options> <url>                            
  Options:                                            
    -c, --connections <N>  Connections to keep open   
    -d, --duration    <T>  Duration of test           
    -t, --threads     <N>  Number of threads to use   
                                                      
    -s, --script      <S>  Load Lua script file       
    -H, --header      <H>  Add header to request      
        --latency          Print latency statistics   
        --timeout     <T>  Socket/request timeout     
    -v, --version          Print version details      
                                                      
  Numeric arguments may include a SI unit (1k, 1M, 1G)
  Time arguments may include a time unit (2s, 2m, 2h)

中文

例子

最后更新于