今天發現到一個針對Apache Web Server的壓力/效能測試工具,在此做個簡單的筆記:
Tools: ApacheBench
Function: 針對某一Web Server提出連線請求,並且在同一時間內可設定幾個連線請求
Usage: # ab -n N -c N http://server1.example.com/index.html
-c concurrency
             Number of multiple requests to perform at a time. Default is one request at a time.
-n requests
             Number of requests to perform for the benchmarking session. The default is to  just  perform
             single request which usually leads to non-representative benchmarking results.
Executed Result:
[root@server2 ~]# ab -n 100 -c 100 https://10.5.40.195/script/login.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.5.40.195 (be patient).....done
Server Software:        Apache
Server Hostname:        10.5.40.195
Server Port:            443
SSL/TLS Protocol:       TLSv1/SSLv3,DHE-RSA-AES256-SHA,1024,256
Document Path:          /script/login.php
Document Length:        5953 bytes
Concurrency Level:      100
Time taken for tests:   14.492808 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      635400 bytes
HTML transferred:       595300 bytes
Requests per second:    6.90 [#/sec] (mean)
Time per request:       14492.808 [ms] (mean)
Time per request:       144.928 [ms] (mean, across all concurrent requests)
Transfer rate:          42.78 [Kbytes/sec] received
Connection Times (ms)
             min  mean[+/-sd] median   max
Connect:      680 5075 3167.2   4795   14099
Processing:   114  959 1238.7    540    6085
Waiting:      112  913 1240.5    506    6082
Total:        896 6035 3844.3   5503   14470
Percentage of the requests served within a certain time (ms)
 50%   5503
 66%   6735
 75%   7557
 80%   8250
 90%  14178
 95%  14334
 98%  14444
 99%  14470
100%  14470 (longest request)
No comments:
Post a Comment