测试PHP的响应时间

发布于 2024-09-27 23:22:54 字数 149 浏览 2 评论 0原文

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

我可以简单地请求一个记录开始时间和结束时间的页面,但我想测量 100 个请求所花费的平均时间。 Ajax之类的东西会有帮助吗?

For my research purposes, I have modified the php sinterpreter and I want to test the response time of the new modified interpreter. So I am looking for a script that would help me achieve my objective.

I could simply request for a page which records start time and the end time but I want to measure the average time taken for 100 requests. Will Ajax or something be of help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌梦深 2024-10-04 23:22:54

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

Apache 的 ab 工作得很好:

$ ab -c 5 -n 200   http://example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 
gt;
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)

A 'page' seems to imply 'test PHP in the webserver' (rather then command line).

Apache's ab works pretty OK for it:

$ ab -c 5 -n 200   http://example.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 
gt;
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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文