0%

web性能测试工具

10大主流压力/负载/性能测试工具:LoadRunner、Apache JMeter、NeoLoad、WebLOAD、Loadster、Load impact、CloudTest、Loadstorm、阿里云PTS、压测宝。

一、ApacheBench

  1. 安装apacheyum install httpd

  2. 语法ab [options] [http[s]://]hostname[:port]/path

  3. 参数说明

参数 说明
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
-t timelimit Seconds to max. to spend on benchmarking.This implies -n 50000
-s timeout Seconds to max. wait for each response.Default is 30 seconds
-b windowsize Size of TCP send/receive buffer, in bytes
-B address Address to bind to when making outgoing connections
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header to use for POST/PUT data, eg.’application/x-www-form-urlencoded’ Default is ‘text/plain’
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. ‘Apache=1234’. (repeatable)
-H attribute Add Arbitrary header line, eg. ‘Accept-Encoding: gzip’.Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-q Do not show progress when doing more than 150 requests
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don’t exit on socket receive errors.
-h Display usage information (this message)
-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
-f protocol Specify SSL/TLS protocol (SSL3, TLS1, TLS1.1, TLS1.2 or ALL)
  1. 使用 ab -n 100 -c 50 http://127.0.0.1/index.php

二、Webbench

  1. 安装Webbench

    1
    2
    3
    4
    5
    6
    7
    8
    yum install ctags
    yum install gcc
    mkdir -m 644 -p /usr/local/man/man1

    wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz
    tar zxvf webbench-1.5.tar.gz
    cd webbench-1.5
    make && make install
  2. 语法 webbench [options] URL

  3. 参数说明

参数 说明
-f –force
-r –reload
-t –time
-p –proxy server:port
-c –clients
-9 –http09
-1 –http10
-2 –http11
–get Use GET request method.
–head Use HEAD request method.
–options Use OPTIONS request method.
–trace Use TRACE request method.
-? -h
-V –version
  1. 使用webbench -c 100 -t 10 http://www.qq.com/index.php

三、http_load

  1. 安装http_load

    1
    2
    3
    4
    5
    6
    7
    yum -y install gcc gcc-c++

    wget http://acme.com/software/http_load/http_load-12mar2006.tar.gz
    tar xzvf http_load-12mar2006.tar.gz
    cd http_load-12mar2006
    mkdir /usr/local/man
    make && make install
  2. 语法

    1
    2
    3
    4
    5
    6
    ./http_load [-checksum] [-throttle] [-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file]
    -parallel N | -rate N [-jitter]
    -fetches N | -seconds N
    url_file
    One start specifier, either -parallel or -rate, is required.
    One end specifier, either -fetches or -seconds, is required.
  3. 使用

    • cd http_load-12mar2006
    • vim url,编辑输入要测试的url,保存退出
    • ./http_load -p 100 -s 10 url