程序很是小,解壓後也不到100Kweb
http_load以並行複用的方式運行,用以測試web服務器的吞吐量與負載。可是它不一樣於大多數壓力測試工shell
具,它能夠以一個單一的進程運行,通常不會把客戶機搞死。還能夠測試HTTPS類的網站請求。apache
下載安裝: wget http://www.acme.com/software/http_load/http_load-14aug2014.tar.gz tar zxvf http_load-14aug2014.tar.gz cd http_load-14aug2014 make && make install 命令格式: http_load [-checksum] [-throttle] [-proxy host:port] [-verbose] [-timeout secs] [-sip sip_file] -parallel N | -rate N [-jitter] -fetches N | -seconds N url_file 使用示例: http_load -parallel 10 -fetches 100 url_file url_file文件內容: http://www.baidu.com/ 結果說明: 100 fetches, 10 max parallel,1.06255e+07 bytes, in 2.48953 seconds #請求數,最大進程數,傳輸數據總計,運行用時 106255 mean bytes/connection #每一個請求/鏈接傳輸的數據量 40.1683 fetches/sec, 4.26808e+06 bytes/sec #每秒請求數,每秒傳輸的數據量 msecs/connect: 0.0879 mean, 0.236 max, 0.028 min #平均響應時間,最大響應時間,最小響應時間 msecs/first-response: 238.966 mean, 350.087 max, 98.128 min # HTTP response codes: code 200 -- 100
要注意是否系統遇到了瓶頸。特殊說明:測試結果中主要的指標是 fetches/sec、msecs/connect 這個選項,即服務器每秒可以響應的查詢次數,windows
用這個指標來衡量性能。彷佛比 apache的ab準確率要高一些,也更有說服力一些。Qpt-每秒響應用戶數和response time,每鏈接響應用戶時間。服務器
測試的結果主要也是看這兩個值。固然僅有這兩個指標並不能完成對性能的分析,咱們還須要對服務器的cookie
cpu、men進行分析,才能得出結論網絡
webbench是Linux下的一個網站壓力測試工具,最多能夠模擬3萬個併發鏈接去測試網站的負載能力。併發
下載安裝: wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz tar zxvf webbench-1.5.tar.g cd webbench-1.5 make && make install 命令格式: 使用示例: 結果說明:
ab是apache自帶的一款功能強大的測試工具
app
命令格式: Usage: ab [options] [http[s]://]hostname[:port]/path Options are: -n requests Number of requests to perform -c concurrency Number of multiple requests to make at a time -t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 seconds -b windowsize Size of TCP send/receive buffer, in bytes -B address Address to bind to when making outgoing connections -p postfile File containing 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 to use for POST/PUT data, eg. 'application/x-www-form-urlencoded' Default is 'text/plain' -v verbosity How much troubleshooting info to print -w Print out results in HTML tables -i Use HEAD instead of GET -x attributes String to insert as table attributes -y attributes String to insert as tr attributes -z attributes String to insert as td or th attributes -C attribute Add cookie, eg. 'Apache=1234'. (repeatable) -H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip' Inserted after 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 Do not show percentiles served table. -S Do not show confidence estimators and warnings. -q Do not show progress when doing more than 150 requests -l Accept variable document length (use this for dynamic pages) -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 (See openssl ciphers) -f protocol Specify SSL/TLS protocol (SSL3, TLS1, TLS1.1, TLS1.2 or ALL) 使用示例: ab -c10 n100 http://www.baidu.com 結果說明: Benchmarking www.baidu.com (be patient).....done Server Software: BWS/1.1 Server Hostname: www.baidu.com Server Port: 80 Document Path: / Document Length: 95852 bytes Concurrency Level: 10 Time taken for tests: 1.406 seconds Complete requests: 100 Failed requests: 97 (Connect: 0, Receive: 0, Length: 97, Exceptions: 0) Total transferred: 9674753 bytes HTML transferred: 9572326 bytes Requests per second: 71.13 [#/sec] (mean) Time per request: 140.584 [ms] (mean) Time per request: 14.058 [ms] (mean, across all concurrent requests) Transfer rate: 6720.53 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 24 32 4.6 33 41 Processing: 74 102 20.6 101 248 Waiting: 26 37 15.5 35 182 Total: 99 134 24.0 134 281 Percentage of the requests served within a certain time (ms) 50% 134 66% 143 75% 153 80% 154 90% 155 95% 159 98% 170 99% 281 100% 281 (longest request)
一款開源的壓力測試工具,能夠根據配置對一個WEB站點進行多用戶的併發訪問,記錄每一個用戶全部請求過程的相應時間,並在必定數量的併發訪問下重複進行。
官方:http://www.joedog.org/
socket
下載安裝: wget http://download.joedog.org/siege/siege-latest.tar.gz tar -zxvf siege-latest.tar.gz cd siege-latest ./configure make&&make install 命令格式: 使用示例: siege -c 200 -r 10 -f example.url 結果說明: Lifting the server siege… done. Transactions: 3419263 hits #完成419263次處理 Availability: 100.00 % #100.00 % 成功率 Elapsed time: 5999.69 secs #總共用時 Data transferred: 84273.91 MB #共數據傳輸84273.91 MB Response time: 0.37 secs #相應用時1.65秒:顯示網絡鏈接的速度 Transaction rate: 569.91 trans/sec #均每秒完成 569.91 次處理:表示服務器後 Throughput: 14.05 MB/sec #平均每秒傳送數據 Concurrency: 213.42 #實際最高併發數 Successful transactions: 2564081 #成功處理次數 Failed transactions: 11 #失敗處理次數 Longest transaction: 29.04 #每次傳輸所花最長時間 Shortest transaction: 0.00 #每次傳輸所花最短期