Introduction to Concurrent Pressure Performance Test Tools

Posted by BinaryBird on Thu, 11 Jul 2019 18:07:57 +0200

1. AB Pressure Test Tool (ApacheBench)

1. Installation

  • linux Installation

    yum -y install httpd-tools

  • windosinstall

    // Download Apache software (ab software is not updated separately, but integrated independently into Apache)
    download https://de.apachehaus.com/downloads/httpd-2.4.39-o102s-x64-vc14.zip
    // Open Compressed Package
    unzip httpd-2.4.39-o102s-x64-vc14.zip
    // Copy ab.exe or abs.exe from the bin directory into the system environment variable path

2. Use

  • Common Cases

    abs -c 200 -n 1000 http://www.baidu.com/index.html
    ab -c 200 -n 1000 http://www.baidu.com/index.html

3. Explanation of parameters

  • Parameter Content

    -n, requests, specifies the total number of times a stress test has been executed.
    -c, concurrency, is used for the specified number of concurrencies.
    -t is the timelimit, the maximum time (in seconds) to wait for a response.
    -b is the windowsize, the buffer size (in bytes) that TCP sends/receives.
    -p is the postfile, which needs to be uploaded when a POST request is sent. In addition, the -T parameter must be set.
    -u is the putfile, which needs to be uploaded when sending a PUT request. In addition, the -T parameter must be set.
    -T, or content-type, sets the Content-Type request header information, for example: application/x-www-form-urlencoded, defaulting to text/plain.
    -v, verbosity, specifies the level of redundancy in printing help information.
    -w Prints the results as an HTML table.
    -i Use HEAD requests instead of GET requests.
    -x Inserts a string as a property of the table tag.
    -y Inserts a string as a property of the tr tag.
    -z Inserts a string as a property of the td tag.
    -C Add cookie information, such as "Apache=1234" (you can repeat this parameter option to add more than one).
    -H Add any request header, such as "Accept-Encoding: gzip", and the request header will be added after the existing multiple request headers (you can repeat this parameter option to add multiple).
    -A Add a basic network authentication information, separated by a colon in English between the user name and password.
    -P adds a basic proxy authentication information, separated by an English colon between the user name and password.
    -X specifies the use and port number, for example, "126.10.10.3:88".
    -V Print version number and exit.
    -k uses the KeepAlive feature of HTTP.
    -d does not show percentages.
    -S does not display estimates and warnings.
    -g Output the result information to a file in gnuplot format.
    -e Output the result information to a CSV format file.
    -r Specifies that the program will not exit when error information is received.
    -h Displays usage information, which is ab-help.

4. Explanation of the contents of the report

  • Result Content

    Server Software:        nginx/1.10.2    (Server software name and version information)
    Server Hostname:        192.168.1.106   (Server Host Name)
    Server Port:            80  (Server Port)
    Document Path:          /index.html     (For testing URL Route)
    Document Length:        3721 bytes  (For testing URL Document Size Returned)
    Concurrency Level:      1000    (Concurrency Number)
    Time taken for tests:   2.327 seconds   (Total time spent on stress testing)
    Complete requests:      5000    (Total Number)
    Failed requests:        688     (Number of failed requests)
    Write errors:           0       (Number of network connection write errors)
    Total transferred:      17402975 bytes  (Total data transferred)
    HTML transferred:       16275725 bytes  (HTML Total amount of data in the document)
    Requests per second:    2148.98 [#/sec] (mean) (average requests per second, server throughput)
    Time per request:       465.338 [ms] (mean) (All concurrent users(This is 1000)Average time to request once)
    Time  request:       0.247 [ms]  (Average time a single user requests)
    Transfer rate:          7304.41 [Kbytes/sec] received Length of data fetched per second (Transmission rate in: KB/s)
    ...
    Percentage of the requests served within a certain time (ms)
    50%    347  ## 50% of requests returned within 347ms 
    66%    401  ## 60% of requests returned within 401ms 

5. Reference Documents

Centos 7ab Pressure Test Installation and Interpretation




2. http_load Pressure Test Tool

1. Installation

yum -y install gcc
wget http://www.acme.com/software/http_load/http_load-09Mar2016.tar.gz
tar zxf http_load-09Mar2016.tar.gz
cd http_load-09Mar2016
make && make install




3. webbench Pressure Test Tool

1. Installation

wget http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install

2. Use

Webbench-c concurrency count-t run test time URL

webbench -c 5000 -t 120 http://www.google.com




IV. Siege Pressure Test Tools

1. Installation

wget http://download.joedog.org/siege/siege-4.0.4.tar.gz
tar zxf siege-4.0.4.tar.gz
cd siege-4.0.4/
./configure
sudo make
sudo make install
siege -V

2. Examples of applications

  1. Basic Applications
    siege -c10 -r1 -p url

  2. Support for multiple Header parameters
    siege -c10 -r1 -p --header="Authorization: 123456" --header="sg: 123456"

  3. Support application/json mode requests
    siege -c1 -r1 "http://localhost:8080/api/test PUT < input.json"

  4. Supports reading URLs from files
    siege -c9 -r1 -f url.txt

3. References

https://www.jianshu.com/p/74c465ff136f

Topics: PHP Apache yum network sudo