AB testing is a popular and easy-to-use stress testing toolkit in the industry. This article will briefly introduce the methods used in its core
ab is the abbreviation of Apache HTTP server benchmarking tool, which can be used to test the server performance of HTTP requests. It provides an easy-to-use performance test tool command combination through different parameters of the command line.
Parameter description: -n the number of requests, -c the number of concurrent
ab option url-address
Case 1: ab -n1000 -c10 http://www.sina.com.cn/index.html
结果信息如下:
fantasy@fantasy-PC / $ ab -n1000 -c10 http://www.sina.com.cn/index.html
This is ApacheBench, Version 2.3 <
>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.sina.com.cn (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: nginx
Server Hostname: www.sina.com.cn
Server Port: 80
Document Path: /index.html
Document Length: 21831 bytes
Concurrency Level: 10
Time taken for tests: 1.625 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 22403053 bytes
HTML transferred: 21831000 bytes
Requests per second: 615.28 [#/sec] (mean)
Time per request: 16.253 [ms] (mean)
Time per request: 1.625 [ms] (mean, across all concurrent requests)
Transfer rate: 13461.12 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 3 4 1.1 4 17
Processing: 8 12 7.5 10 80
Waiting: 4 7 6.7 6 73
Total: 11 16 7.8 14 84
Percentage of the requests served within a certain time (ms)
50% 14
66% 15
75% 15
80% 16
90% 20
95% 26
98% 37
99% 65
100% 84 (longest request)
References
http://httpd.apache.org/docs/current/programs/ab.html
We can follow the above example to test different websites for comparison