Ab is a very good stress test tool of apache. When apache is installed, you can find ab under bin.
We can simulate 100 concurrent users and send 1000 requests to a page.as follow:
./ab -n1000 -c100 http://mytest.com/a.html
Where -n represents the number of requests and -c represents the number of concurrent
Return results:
First is the version information of apache
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://mytest.com/
Licensed to The Apache Software Foundation, http://mytest.com/
Benchmarking vm1.jianfeng.com (be patient)
Server Software: Apache/2.2.19 ##apache version
Server Hostname: mytest.com ##Requested machine
Server Port: 80 ##Request Port
Document Path: /a.html
Document Length: 25 bytes ##Page Length
Concurrency Level: 100 ##Concurrent Numbers
Time taken for tests: 0.273 seconds ## How much time did you use?
Complete requests: 1000 ##Requests
Failed requests: 0 ##Failed requests
Write errors: 0
Total transferred: 275000 bytes ## Total number of bytes transferred, including http header information, etc.
HTML transferred: 25000 bytes ##htmlbytes, the actual number of bytes passed by the page
Requests per second: 3661.60 #/sec ##How many requests per second, this is a very important parameter value, server throughput
Time per request: 27.310 ms ##User average request waiting time
Time per request: 0.273 [ms] (mean, across all concurrent requests) ##Server average processing time, which is the reciprocal of server throughput
Transfer rate: 983.34 [Kbytes/sec] received ## The data length obtained per second
Connection Times (ms)
Min mean[+/-sd] median max
Connect: 0 1 2.3 0 16
Processing: 6 25 3.2 25 32
Waiting: 5 24 3.2 25 32
Total: 6 25 4.0 25 48
Percentage of the requests served within a certain time (ms)
50% 25 ## 50% of requests returned within 25ms
66% 26 ## 60% of requests returned within 26ms
75% 26
80% 26
90% 27
95% 31
98% 38
99% 43
100% 48 (longest request)