dousi1961 2010-10-16 23:18
浏览 12
已采纳

测试PHP的响应时间

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.

  • 写回答

1条回答 默认 最新

  • dove2199 2010-10-16 23:39
    关注

    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 $>
    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)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Mac系统vs code使用phpstudy如何配置debug来调试php
  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)