[CMD] Load Testing from your Mac / Linux using Apache Bench

Mac or Linux server has pre-installed Apache Bench which we can use for load testing for free. I am not sure about the limitation, but from my machine (Macbook Pro 2015), I can do load testing up to 200 concurrent connections.

We can simply run this command in terminal

ab -n 100 -c 10 http://www.yahoo.com/

100 is total connections we will test, and 10 is the maximum concurrent we will test.

The report will be produced once it is completed.

Concurrency Level:      10
Time taken for tests:   1.889 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      1003100 bytes
HTML transferred:       949000 bytes
Requests per second:    52.94 [#/sec] (mean)
Time per request:       188.883 [ms] (mean)
Time per request:       18.888 [ms] (mean, across all concurrent requests)
Transfer rate:          518.62 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       57   59   1.7     59      64
Processing:   117  126   7.5    124     162
Waiting:       57   62   7.0     60      98
Total:        175  186   8.0    184     224

Percentage of the requests served within a certain time (ms)
  50%    184
  66%    186
  75%    187
  80%    188
  90%    192
  95%    203
  98%    216
  99%    224
 100%    224 (longest request)

Reference: https://www.petefreitag.com/item/689.cfm

Leave a Reply

Your email address will not be published. Required fields are marked *