全球主机交流论坛
标题:
关于用AB工具测试vps的负载问题?请教大神~
[打印本页]
作者:
zch0071
时间:
2010-12-3 12:40
标题:
关于用AB工具测试vps的负载问题?请教大神~
我使用的是centos+apache+php+mysql的模式。在使用ab工具测试负载时候出现个问题。
就是使用apache中自带的测试工具ab测试网站(选了一个php的页面), -n 10 -c 1,发现失败请求数很多,请问下是什么原因呢?而且测试的数目很少,多了就不行了。
我怎么优化之?
Server Software: Apache/2.2.3
Server Hostname: www.domain.com
Server Port: 80
Document Path: /
Document Length: 94938 bytes
Concurrency Level: 1
Time taken for tests: 4.663408 seconds
Complete requests: 10
Failed requests: 9
(Connect: 0, Length: 9, Exceptions: 0)
Write errors: 0
Total transferred: 952176 bytes
HTML transferred: 947366 bytes
Requests per second: 2.14 [#/sec] (mean)
Time per request: 466.341 [ms] (mean)
Time per request: 466.341 [ms] (mean, across all concurrent requests)
Transfer rate: 199.21 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 434 465 23.9 462 508
Waiting: 433 465 23.9 462 508
Total: 434 465 23.9 462 508
Percentage of the requests served within a certain time (ms)
50% 462
66% 471
75% 480
80% 497
90% 508
95% 508
98% 508
99% 508
100% 508 (longest request)
复制代码
但是如果我测试的是静态页面,就没有什么问题----------这个页面时静态页面,没有任何失败请求
Server Software: Apache/2.2.3
Server Hostname: *.*.*.*
Server Port: 80
Document Path: /
Document Length: 1942 bytes
Concurrency Level: 10
Time taken for tests: 0.629372 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 2309000 bytes
HTML transferred: 1942000 bytes
Requests per second: 1588.89 [#/sec] (mean)
Time per request: 6.294 [ms] (mean)
Time per request: 0.629 [ms] (mean, across all concurrent requests)
Transfer rate: 3581.35 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 5
Processing: 0 5 3.6 5 41
Waiting: 0 5 3.6 5 40
Total: 0 5 3.7 5 41
Percentage of the requests served within a certain time (ms)
50% 5
66% 6
75% 6
80% 7
90% 8
95% 10
98% 15
99% 28
100% 41 (longest request)
复制代码
大家可以看到上面第一个测试和第二个测试的差别?所以我想问下,怎么才能减少请求失败数?和优化系统?
作者:
aru
时间:
2010-12-3 12:48
每秒处理请求不到三个,太慢了
作者:
kyo1
时间:
2010-12-3 12:48
apache 处理不过来
作者:
yaoe
时间:
2010-12-3 12:49
纯apache是慢点,用mod_php能好些,lnamp效果就很棒了
[
本帖最后由 yaoe 于 2010-12-3 13:01 编辑
]
作者:
zch0071
时间:
2010-12-3 13:24
怎么优化?
作者:
zch0071
时间:
2010-12-3 14:30
。。。。。没有谁能告诉我怎么优化么?
作者:
zch0071
时间:
2010-12-3 17:18
但是我问了我的客户,他们说访问网站很快,并没有什么连接不上的。。。。所以我现在就很奇怪了。
ab工具测试网站动态页,性能极差。。。但是客户访问有很好。。。。不明白啊。
作者:
wHOaMi
时间:
2010-12-3 23:48
試試用webbench
wget http://acelnmp.googlecode.com/files/webbench-1.5.tar.gz
tar zxvf webbench-1.5.tar.gz
cd webbench-1.5
make && make install
cd ..
rm -rf webbench-1.5*
复制代码
使用方法
webbench -c 500 -t 30
http://www.sunk.eu.org/pm.php
-c表示並發數,-t表示時間(秒)
webbench -c 500 -t 30 http://www.sunk.eu.org/pm.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://www.sunk.eu.org/pm.php
500 clients, running 30 sec.
Speed=16526 pages/min, 3028932 bytes/sec.
Requests: 8263 susceed, 0 failed.
复制代码
作者:
zch0071
时间:
2010-12-4 14:18
我安装了,下面是测试数据
webbench -c 500 -t 30 http://www.*********.com/
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://www.************e.com/
500 clients, running 30 sec.
Speed=278 pages/min, 441401 bytes/sec.
Requests: 139 susceed, 0 failed.
复制代码
作者:
foxlovefox
时间:
2010-12-4 14:31
嗯。。就处理了139个、
欢迎光临 全球主机交流论坛 (https://sunk.eu.org/)
Powered by Discuz! X3.4