Apache 访问日志中的 %D 字段 - 第一个字节还是最后一个字节?
Apache Httpd 手册中有一个关于自定义访问日志格式的部分。这些选项之一是 %D
字段,其记录为
处理请求所花费的时间(以微秒为单位)。
谁能告诉我这到底是在测量什么?例如,它是第一个字节的时间,还是最后一个字节的时间,或者比这更复杂的东西?
我需要这是证明符合性能要求,并且我想确切地知道这里测量的是什么。
The Apache Httpd manual has a section on custom access log formats. One of these options is the %D
field, which is documented as
The time taken to serve the request, in microseconds.
Can anyone tell me what exactly this is measuring? Is it time-to-first-byte, or time-to-last-byte, for example, or something more complex than that?
I need this is demonstrate compliance to performance requirements, and I want to know exactly what's being measured here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
它是最后一个字节,或者更确切地说,是在记录阶段计算出的
apr_time_now() - request_rec->request_time
。该阶段发生在处理周期的最后,即发送响应之后。It's the last byte or rather,
apr_time_now() - request_rec->request_time
which is worked out during the logging phase. That phase happens last in the processing cycle, after the response has been sent.http://code.google.com/p/mod-log-firstbyte/ 似乎暗示 %D 测量到最后一个字节的时间,而 mod-log-firstbyte 测量到第一个字节的时间。
http://code.google.com/p/mod-log-firstbyte/ seems to imply that %D measures the time to last byte, whereas mod-log-firstbyte measures the time to first byte.
了解这两个值对于性能调试都很有用。
到第一个字节的时间是连接的等待时间或延迟,而 %D 还包括传输时间。
总时间是您用于总体性能和容量规划的时间,而等待时间是您尝试尽量减少的时间。
Both values are useful to know for performance debugging.
Time to first byte is the wait time or latency of the connection, while %D also includes the transfer time.
The total time is what you use for overall performance and capacity planning, while the wait is what you try to minimize.