ab Testing Tool - Server Stress Testing Details

Posted by sijis on Wed, 31 Jul 2019 12:08:19 +0200

ab pressure testing tool

Ab is a tool for testing Apache Hypertext Transfer Protocol (HTTP) servers. Apache comes with ab tools, which can test apache, IIs, tomcat, nginx, web and other servers

But ab does not have Jmeter, Loadrunner, such as a variety of scenario design, various graphics reports and monitoring, just one command can be used, there is an output description.

It's easy to do some stress tests.

I. apache comes with Mac

View version apachectl-v

Take Baidu as an example: http://httpd.apache.org/docs/2.4/programs/ab.html Details are available on the official website.

The ab command satisfies both http and https requests

Common request parameters: - n number of requests, - c concurrency

Taking Baidu as an example, the execution statement and specific analysis are as follows:

root@instance-lvzxy101:~# ab -c 10 -n 100 https://www.baidu.com/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
//apache version information
Benchmarking www.baidu.com (be patient).....done


Server Software:        BWS/1.1
//The request returns the header type, possibly nginx, apache, IIs, etc.
Server Hostname:        www.baidu.com
//Request ip or domain name
Server Port:            443
//Request port, the current request is https, so port 443, request HTTPS port 80
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
//https port protocol
TLS Server Name:        www.baidu.com

Document Path:          /
//Route
Document Length:        227 bytes
//The byte size of the first successfully returned document

Concurrency Level:      10
//Concurrent Number!!!
Time taken for tests:   0.232 seconds
//Total Acceptance Completion Time from Establishment Connection
Complete requests:      100
//Successful total number of requests
Failed requests:        0
//Aborted
Total transferred:      89300 bytes
//The total number of bytes received from the server
HTML transferred:       22700 bytes
//Number of bytes received by HTML
Requests per second:    430.62 [#/sec] (mean)
--Number of requests per second (total number of requests)/Total time)
Time per request:       23.222 [ms] (mean)
--Average Request Waiting Time of Users=concurrency * timetaken * 1000 / done
//Reference to the average response time in Jmeter and LR
Time per request:       2.322 [ms] (mean, across all concurrent requests)
--Average response time per request processed by the server=timetaken * 1000 / done
Transfer rate:          375.53 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        9   12   6.9     12      79
Processing:     3    5   0.6      5       7
Waiting:        3    5   0.6      5       6
Total:         13   17   6.9     17      82
//Network Connection
Percentage of the requests served within a certain time (ms)
  50%     17
  66%     18
  75%     18
  80%     18
  90%     19
  95%     19
  98%     20
  99%     82
 100%     82 (longest request)
//Distribution Ratio of Overall Response Time

 

Topics: Apache IIS Nginx Tomcat