【问题标题】:Definition of Connect, Processing, Waiting in apache benchapache bench中连接、处理、等待的定义
【发布时间】:2011-02-18 16:52:48
【问题描述】:

当我运行 apache bench 时,我得到如下结果:

Command: abs.exe -v 3 -n 10 -c 1 https://mysite
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:      203  213   8.1    219     219
Processing:    78  177  88.1    172     359
Waiting:       78  169  84.6    156     344
Total:        281  389  86.7    391     564

我似乎找不到连接、处理和等待的定义。这些数字是什么意思?

【问题讨论】:

    标签: performance apache benchmarking


    【解决方案1】:

    通过查看源代码,我们发现了这些时间点:

    apr_time_t start,           /* Start of connection */
               connect,         /* Connected, start writing */
               endwrite,        /* Request written */
               beginread,       /* First byte of input */
               done;            /* Connection closed */
    

    当请求完成时,一些时间存储为:

            s->starttime = c->start;
            s->ctime     = ap_max(0, c->connect - c->start);
            s->time      = ap_max(0, c->done - c->start);
            s->waittime  = ap_max(0, c->beginread - c->endwrite);
    

    “处理时间”稍后计算为

    s->time - s->ctime;
    

    因此,如果我们将其转换为时间线:

    t1: Start of connection
    t2: Connected, start writing
    t3: Request written
    t4: First byte of input
    t5: Connection closed
    

    那么定义将是:

    Connect:      t1-t2   Most typically the network latency
    Processing:   t2-t5   Time to receive full response after connection was opened
    Waiting:      t3-t4   Time-to-first-byte after the request was sent
    Total time:   t1-t5
    

    【讨论】:

    • 最佳答案在这里。谢谢!
    • apache bench 源代码托管在哪里?即使在 apache 的开源列表中,我似乎也找不到它。
    • 完美!谢谢。让我称你为伟大的逆转者!
    【解决方案2】:

    连接:连接到远程主机所需的时间

    处理:总时间减去连接到远程主机所需的时间

    等待:响应第一个字节接收减去最后一个字节发送

    总计:从连接前到连接关闭后

    【讨论】:

      【解决方案3】:

      来自http://chestofbooks.com/computers/webservers/apache/Stas-Bekman/Practical-mod_perl/9-1-1-ApacheBench.html

      连接和等待时间

      建立连接并获得响应的第一个位所花费的时间

      处理时间

      服务器响应时间——即服务器处理请求并发送回复所用的时间

      总时间

      连接和处理时间的总和

      我将其等同于:

      • 连接时间:打开套接字所花费的时间
      • 处理时间:第一个字节+传输
      • 等待:距离第一个字节的时间
      • 总计:连接 + 处理的总和

      【讨论】:

      • 我认为处理时间包括等待时间,否则总时间将是连接+等待+处理。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-26
      • 2011-08-21
      • 2021-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多