|
我使用的是centos+apache+php+mysql的模式。在使用ab工具测试负载时候出现个问题。
就是使用apache中自带的测试工具ab测试网站(选了一个php的页面), -n 10 -c 1,发现失败请求数很多,请问下是什么原因呢?而且测试的数目很少,多了就不行了。
我怎么优化之?[ol]Server Software: Apache/2.2.3Server Hostname: www.domain.comServer Port: 80Document Path: /Document Length: 94938 bytesConcurrency Level: 1Time taken for tests: 4.663408 secondsComplete requests: 10Failed requests: 9 (Connect: 0, Length: 9, Exceptions: 0)Write errors: 0Total transferred: 952176 bytesHTML transferred: 947366 bytesRequests 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] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 0 0.0 0 0Processing: 434 465 23.9 462 508Waiting: 433 465 23.9 462 508Total: 434 465 23.9 462 508Percentage 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)[/ol]复制代码但是如果我测试的是静态页面,就没有什么问题----------这个页面时静态页面,没有任何失败请求[ol]Server Software: Apache/2.2.3Server Hostname: *.*.*.*Server Port: 80Document Path: /Document Length: 1942 bytesConcurrency Level: 10Time taken for tests: 0.629372 secondsComplete requests: 1000Failed requests: 0Write errors: 0Total transferred: 2309000 bytesHTML transferred: 1942000 bytesRequests 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] receivedConnection Times (ms) min mean[+/-sd] median maxConnect: 0 0 0.4 0 5Processing: 0 5 3.6 5 41Waiting: 0 5 3.6 5 40Total: 0 5 3.7 5 41Percentage 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)[/ol]复制代码大家可以看到上面第一个测试和第二个测试的差别?所以我想问下,怎么才能减少请求失败数?和优化系统? |
|