2013-12-09 61 views
0

我在码头上运行,我的访问日志配置为显示响应时间。今天负响应时间登录

我注意到请求(约30出来的600K)的一个很小的量有负面的反应时间,如果有谁遇到过这样的行为,我想知道。

这是我的响应的一个示例: < [IP]> - - < [日期]> “POST < [URL]> HTTP/1.0” 201 461 -18096

如果要识别这在访问日志中 - 这是grep命令我使用:

的grep --color “ - [0-9] [0-9] *” 服务器access.2013_12_09.log

码头版: 8.1.8

设置中的jetty.xml:

<New id="request-log-handler" class="org.eclipse.jetty.server.handler.RequestLogHandler"> 
<Set name="requestLog"> 
    <New class="org.eclipse.jetty.server.NCSARequestLog"> 
    <Arg> 
     <Property name="logging.httpAccessLog" default="logs/app-access.yyyy_mm_dd.log" /> 
    </Arg> 
    <Set name="retainDays"> 
     <Property name="logging.accessLogRetentionInDays" default="10" /> 
    </Set> 
    <Set name="append"> 
     <Property name="logging.httpAccessLogAppend" default="true" /> 
    </Set> 
    <!-- logs referer and user agent --> 
    <Set name="extended"> 
     <Property name="logging.httpAccessLogExtended" default="false" /> 
    </Set> 
    <!-- response time --> 
    <Set name="logLatency"> 
     <Property name="logging.httpAccessLogLatency" default="true" /> 
    </Set> 
    </New> 
</Set> 

+0

什么版本的码头的? (具体),并且包括你在你的问题中如何配置访问日志记录。 –

回答

1

使用码头9.1.0。

重点:

  • <name> =上线可选/配置入门
  • {name} =必备项

<servername> {X-Forwarded-For||remote-addr} - {authentication/principal/name} [{request-timestamp}] "{method} {uri} {protocol}" {response-status-code} {response-content-length} <extended-log> <cookies> <latency>

其中:

有趣的是,我们发现您的系统时钟时的调整请求。完整的18秒!

这也是为什么这是领先的理论...

request.timestamp is set when the request starts,那么latency is computed later during the access/request logging。如果存在负值,则Jetty外部的某个部分会重置request.timeout或更改系统时钟。

+0

听起来像一个合理的解释,因为:1。我看到所有的负数都出现在同一时间'块'; 2.我有两台机器运行我的服务器,一台机器的负值大约是5秒,另一台机器大约18秒 –