测试PHP的响应时间

时间:2010-10-16 23:18:15

标签: php ajax response

为了我的研究目的,我修改了php sinterpreter,我想测试新修改的解释器的响应时间。所以我正在寻找一个可以帮助我实现目标的脚本。

我可以简单地请求一个记录开始时间和结束时间的页面,但我想测量100个请求的平均时间。阿贾克斯会不会有所帮助。

2 个答案:

答案 0 :(得分:4)

'page'似乎意味着'在网络服务器中测试PHP(而不是命令行)。

Apache's ab非常适合:

$ ab -c 5 -n 200   http://example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking example.com (be patient)
Completed 100 requests
Completed 200 requests
Finished 200 requests


Server Software:        Apache
Server Hostname:        example.com
Server Port:            80

Document Path:          /
Document Length:        596 bytes

Concurrency Level:      5
Time taken for tests:   15.661 seconds
Complete requests:      200
Failed requests:        0
Write errors:           0
Total transferred:      173600 bytes
HTML transferred:       119200 bytes
Requests per second:    12.77 [#/sec] (mean)
Time per request:       391.532 [ms] (mean)
Time per request:       78.306 [ms] (mean, across all concurrent requests)
Transfer rate:          10.82 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      184  193   8.9    190     235
Processing:   184  196  13.2    192     280
Waiting:      184  196  13.2    192     280
Total:        368  390  15.0    387     469

Percentage of the requests served within a certain time (ms)
  50%    387
  66%    393
  75%    398
  80%    400
  90%    410
  95%    418
  98%    423
  99%    446
 100%    469 (longest request)

答案 1 :(得分:0)

如何运行本地网站并使用iMacros for Firefox / Chrome / IE及其STOPWATCH命令计时?我们将其用于Web性能测试。

您可以使用iMacros侧边栏上的循环按钮运行测试序列100x。