我使用的是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 (mean)
  • Time per request: 466.341 (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 (mean)
  • Time per request: 0.629 (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)复制代码大家可以看到上面第一个测试和第二个测试的差别?所以我想问下,怎么才能减少请求失败数?和优化系统?