zoukankan      html  css  js  c++  java
  • wrk压测工具安装和使用

    wrk压测工具安装:

    mkdir wrk
    git clone https://github.com/wg/wrk.git
    cd wrk/
    cp wrk /usr/sbin/
    

    wrk压测工具使用

    使用方法: wrk <选项> <被测HTTP服务的URL>                            
      Options:                                            
        -c, --connections <N>  跟服务器建立并保持的TCP连接数量  
        -d, --duration    <T>  压测时间           
        -t, --threads     <N>  使用多少个线程进行压测   
                                                          
        -s, --script      <S>  指定Lua脚本路径       
        -H, --header      <H>  为每一个HTTP请求添加HTTP头      
            --latency          在压测结束后,打印延迟统计信息   
            --timeout     <T>  超时时间     
        -v, --version          打印正在使用的wrk的详细版本信息
                                                          
      <N>代表数字参数,支持国际单位 (1k, 1M, 1G)
      <T>代表时间参数,支持时间单位 (2s, 2m, 2h)
    

    使用案例:

    [root@master1 wrk-master]# wrk -t4 -c1000 -d60s http://www.baidu.net
    Running 1m test @ http://www.chenleilei.net
      4 threads and 1000 connections
      Thread Stats   Avg      Stdev     Max   +/- Stdev
        Latency   269.18ms  387.89ms   2.00s    83.74%
        Req/Sec   150.78     73.41     0.92k    68.04%
      35079 requests in 1.00m, 11.94MB read
      Socket errors: connect 0, read 0, write 340, timeout 2921
    Requests/sec:    584.15
    Transfer/sec:    203.65KB
    

    微信赞赏

    支付宝赞赏

  • 相关阅读:
    爽肤水
    Python面向对象关系
    Linux多线程编程
    Python数据库工具类MySQLdb使用
    Python配置工具类ConfigParser使用
    采用RedisLive监控Redis服务——安装手册
    采用JavaMelody监控Tomcat服务——安装手册
    怎么做性能测试--响应时间
    robot framework测试驱动无法定位页面元素
    使用Loadrunner对IBM MQ进行性能测试
  • 原文地址:https://www.cnblogs.com/superlinux/p/12598123.html
Copyright © 2011-2022 走看看