httperf+autobench测试web应用

  • 测试性能相关的概念理解

    

  • httperf使用 

  主页:  http://www.hpl.hp.com/research/linux/httperf/

  下载: http://httperf.googlecode.com/files/httperf-0.9.0.tar.gz

  

  httperf --help

 其中常用的参数的含义
    • --server S web服务器地址
    • --num-conns N 测试联接数
    • --num-calls N 每连接中发起联接数,一般是1
    • --rate N 每秒请求数
    • --port N 测试端口
    • −−method S 测试HTTP方法,默认为GET
    • --uri S 测试网页,默认为/
    • --timeout N 等待服务器响应时间
  • autobench使用

  主页: http://www.xenoclast.org/autobench

  下载:http://www.xenoclast.org/autobench/downloads/autobench-2.1.2.tar.gz

  tar vxf autobench-2.1.2.tar.gz

  cd  autobench-2.1.2.tar.gz

  make;make install 

  如果想要将数据转换成图形样式,可以用gnuplot包

  

  autobench --single_host --host1 www.test.com --uri1 /10K --quiet    
          --low_rate 20 --high_rate 200 --rate_step 20 --num_call 10
          --num_conn 5000 --timeout 5 --file results.tsv

其参数含义

    • --signle_host 只测单机
    • --host1 测试主机地址
    • --uri1 host1 测试URI
    • --quiet 安静模式
    • --low_rate 测试时最低请求数(指 httperf)
    • --hight_rate 测试时最高请求数
    • --rate_step 每次测试请求数增加步长
    • --num-call 同httperf
    • --num_conn 同httperf
    • --file 测试结果输出的 tsv文件

  

   如果想要加入httperf程序的参数,需要在配置文件.autobench.conf中写入,可以用httpef_作为开头,写在配置文件中。其他autobench的参数,可以在外部指定 

  如果要将tsv文件结果转换成图形:

  bench2graph  result.tsv result.png [ 1 2 3 .... ]

原文地址:https://www.cnblogs.com/lizhitai/p/4447767.html