apache 压力测试 -- ab工具使用
softiger
|
1#
softiger 发表于 2005-07-27 15:36
apache 压力测试 -- ab工具使用
对apache进行性能测试,结果如下:
================================= [root@Base etc]# cd /usr/local/apache2/bin/ab -n 10000 -c 500 http://www.abcd.com/ -bash: cd: /usr/local/apache2/bin/ab: Not a directory [root@Base etc]# /usr/local/apache2/bin/ab -n 10000 -c 500 http://www.abcd.com/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.10 $>; apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking www.abcd.com (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Finished 10000 requests Server Software: Apache/2.0.50 Server Hostname: www.abcd.com Server Port: 80 Document Path: / Document Length: 117004 bytes Concurrency Level: 500 Time taken for tests: 6.556017 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 1180411690 bytes HTML transferred: 1177530910 bytes Requests per second: 1525.32 [#/sec] (mean) Time per request: 327.801 [ms] (mean) Time per request: 0.656 [ms] (mean, across all concurrent requests) Transfer rate: 175830.08 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 42 336.7 3 3004 Processing: 22 116 192.4 100 3469 Waiting: 8 83 189.8 72 3403 Total: 38 158 486.6 104 6470 Percentage of the requests served within a certain time (ms) 50% 104 66% 107 75% 110 80% 112 90% 117 95% 135 98% 168 99% 3108 100% 6470 (longest request) [root@Base etc]# ====================================================================== [root@Base etc]# /usr/local/apache2/bin/ab -n 10000 -c 500 http://www.abcd.com/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.10 $>; apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking www.abcd.com (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Finished 10000 requests Server Software: Apache/2.0.50 Server Hostname: www.abcd.com Server Port: 80 Document Path: / Document Length: 117004 bytes Concurrency Level: 500 Time taken for tests: 6.556017 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 1180411690 bytes HTML transferred: 1177530910 bytes Requests per second: 1525.32 [#/sec] (mean) Time per request: 327.801 [ms] (mean) Time per request: 0.656 [ms] (mean, across all concurrent requests) Transfer rate: 175830.08 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 42 336.7 3 3004 Processing: 22 116 192.4 100 3469 Waiting: 8 83 189.8 72 3403 Total: 38 158 486.6 104 6470 Percentage of the requests served within a certain time (ms) 50% 104 66% 107 75% 110 80% 112 90% 117 95% 135 98% 168 99% 3108 100% 6470 (longest request) [root@Base etc]# /usr/local/apache2/bin/ab -n 100000 -c 500 http://www.abcd.com/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.10 $>; apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking www.abcd.com (be patient) Completed 10000 requests Completed 20000 requests Completed 30000 requests Completed 40000 requests Completed 50000 requests Completed 60000 requests Completed 70000 requests Completed 80000 requests Completed 90000 requests Finished 100000 requests Server Software: Apache/2.0.50 Server Hostname: www.abcd.com Server Port: 80 Document Path: / Document Length: 117004 bytes Concurrency Level: 500 Time taken for tests: 57.165445 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: -1130288720 bytes HTML transferred: -1158910985 bytes Requests per second: 1749.31 [#/sec] (mean) Time per request: 285.827 [ms] (mean) Time per request: 0.572 [ms] (mean, across all concurrent requests) Transfer rate: -19308.82 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 42 441.7 13 9009 Processing: 23 239 462.0 140 27652 Waiting: 4 67 299.5 15 15903 Total: 41 282 694.5 153 27665 Percentage of the requests served within a certain time (ms) 50% 153 66% 159 75% 166 80% 177 90% 429 95% 808 98% 1488 99% 2449 100% 27665 (longest request) ============================================= [root@Base conf]# /usr/local/apache2/bin/ab -n 100000 -c 500 http://www.abcd.com/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.10 $>; apache-2.0 Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ Benchmarking www.abcd.com (be patient) Completed 10000 requests Completed 20000 requests Completed 30000 requests Completed 40000 requests Completed 50000 requests Completed 60000 requests Completed 70000 requests Completed 80000 requests Completed 90000 requests Finished 100000 requests Server Software: Apache/2.0.50 Server Hostname: www.abcd.com Server Port: 80 Document Path: / Document Length: 117004 bytes Concurrency Level: 500 Time taken for tests: 56.941957 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: -1127696396 bytes HTML transferred: -1156320086 bytes Requests per second: 1756.17 [#/sec] (mean) Time per request: 284.710 [ms] (mean) Time per request: 0.569 [ms] (mean, across all concurrent requests) Transfer rate: -19340.15 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 39 332.2 18 9005 Processing: 21 243 445.6 186 14930 Waiting: 5 64 414.8 20 14103 Total: 37 282 638.8 205 17933 Percentage of the requests served within a certain time (ms) 50% 205 66% 212 75% 217 80% 222 90% 377 95% 591 98% 1025 99% 1461 100% 17933 (longest request) [root@Base conf]# ========================================== 感觉服务器有点慢,但不知道怎么调整好,文件大量由静态htm或图片组成。请问那位比较熟悉ab的用法,看看上面的结果怎么样,怎么调整合适,谢谢! |