1. Install AB command
sudo apt-get install apache2-utils
2.ab Command parameter description
Usage:ab [Options] [http[s]://]hostname[:p ort]/path options are://Total requests-N requests number of requests to Perform house//concurrent Request number total requests (n) = number of concurrent (c)-c concurrency number of multiple requests to make-t TI Melimit Seconds to Max. Wait for Responses-b windowsize the Size of TCP send/receive buffer, in Bytes-p postfile File containing the data to POST. Remember also to Set-t-u putfile File containing data to put.
Remember also to set-t-T content-type content-type header for POSTing, eg. ' application/x-www-form-urlencoded ' Default is ' text/plain '-v verbosity how much troubleshooting info to print-w P Rint out results in HTML tables-i use head instead of get-x attributes String to insert as Table attributes-y att Ributes string to insert as TR attributes-z attributes string to insert as TD or TH ATTRIBUTES-C attribute Add Cooki E, eg. ' Apache=1234. (repeatable)-H attribute Add arbitrary header line, eg. ' Accept-encoding:Gzip ' Inserted after the all normal header lines.
(repeatable)-a attribute Add Basic WWW authentication, the attributes are a colon separated username and password.
-P attribute Add Basic Proxy authentication, the attributes are a colon separated username and password. -X Proxy:port ProxyServer and port number to Use-v Print version number and exit-k use HTTP KeepAlive feature-d D
o not show percentiles served table.
-S don't show confidence estimators and warnings.
-G filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served-r Don ' t exit on socket receive errors. -H Display Usage information (this message)-Z ciphersuite specify SSL/TLS cipher Suite (* OpenSSL ciphers)-F Proto Col Specify SSL/TLS protocol (SSL2, SSL3, TLS1, or all)
3. Run ab-n 100-c http://www.meetu.hk/100 requests to http://www.meetu.hk/, 10 concurrent request stress test results.
Server software:lighttpd/1.4.20 Server Hostname:www.meetu.hk server port:80 Document Path:/Document L ength:2095 bytes concurrency level:10//duration of the entire test time taken for tests:3.303//complete Number of requests Complete requests:100 Failed requests:0 Write errors:0 total transferred:235200 bytes HTML Transferre d:209500 Bytes//The average processing of 30 requests per second Requests per second:30.27 [#/sec] (mean)//The average processing time for each request is 330 milliseconds Note: here will be 10 Concurrent requests as a whole time per request:330.335 [MS] (mean)//average concurrent request processing times of 33 ms/request:33.034 [MS] (mean, Across all concurrent requests) Transfer rate:69.53 [kbytes/sec] received Connection times (ms) Min mean[+/ -SD] Median max connect:51 170 35.9 178 230 processing:60 153 64.5 121 263 waiting:55 148 64.4 258 322 59.9 299 437 percentage of the requests served within a certain time (MS)//50% of these 100 requests were completed within 299 milliseconds into 50% 299//Of the 100 requests, 66% completed in 312 milliseconds 66% 312 75% 383 80% 412 90% 431 432 98% 436 99% 437 100% The 437 (longest request)
This column more highlights: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/