Squid TCP_MISS/000 的意义

工作中需要了解Squid TCP_MISS/000 的意义,看了一下squid代码:
在代码Enums.h中:先定义了枚举量:
HTTP_STATUS_NONE = 0,

下面这个 sline结构的status,最后会赋值到在log中看到的TCP_MISS后面000这个http->code变量
这个 sline变量的status值在初始化的时候被初始化为HTTP_STATUS_NONE, 也就是0:
void
httpStatusLineInit(HttpStatusLine * sline)
{
    HttpVersion version;
    httpStatusLineSet(sline, version, HTTP_STATUS_NONE, NULL);
}

其它的 在代码中有几处在分析http header之前 设置了:
 http_status error = HTTP_STATUS_NONE;

如果系统出错会把error赋值给http->code所在的数据结构

总结起来就是在拿不到header头部进行分析的时候,log文件中的http->code这个标记为0

 

对比了一下log, TCP_MISS 后面的http->code有200,304,000三种,000这种后面的cache条目的大小标志位也为0

 

squid log的格式为:  

        logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %"PRId64" %s %s %s %s%s/%s %s/n",
                      (long int) current_time.tv_sec,
                      (int) current_time.tv_usec / 1000,
                      al->cache.msec,
                      client,
                      log_tags[al->cache.code],
                      al->http.code,
                      al->cache.size,
                      al->_private.method_str,
                      al->url,
                      user ? user : dash_str,
                      al->hier.ping.timedout ? "TIMEOUT_" : "",
                      hier_strings[al->hier.code],
                      al->hier.host,
                      al->http.content_type);

看了一下网上资料,如下:
http://www.mail-archive.com/squid-users@squid-cache.org/msg33707.html
TCP_MISS/000 means there was no response. Usually client aborted.
NONE/- indicates Squid could not find where to send the request. I.e. probably DNS related problems.

 

Details about TCP_MISS/000 in access.log

Squid: Details about TCP_MISS/000 in access.log

I noticed some TCP_MISS/000 entries in squid access_log this afternoon, as what I saw 3 years ago.
As we know that TCP_MISS means the URL has no stored objects in cache, and TCP_MISS/000 is the bit usually means aborted, indicating there's no reply to the request before the client aborted the connection. It might be caused by the following reasons:

1, The client aborted request before SQUID could return any data
2, The website might be unavailable, due to DNS issue, network issue or an abnormal running web server.
For DNS issues, we need to check whether the dns server that used by SQUID is working as expected or not.
For network issues, we might need to check network connection status, packet lost, transfer latency or something else.
To check a web server, you can send some command to its service port, usually, you can follow this command:

$ telnet Your.Server.tld 80 [return]
GET / HTTP/1.0 [return][return]

If there is no output, you might need to restart the web server. [over]

 

 

I noticed some TCP_MISS/000 entries in squid access_log this afternoon, as what I saw 3 years ago.
As we know that TCP_MISS means the URL has no stored objects in cache, and TCP_MISS/000 is the bit usually means aborted, indicating there's no reply to the request before the client aborted the connection. It might be caused by the following reasons:

1, The client aborted request before SQUID could return any data
2, The website might be unavailable, due to DNS issue, network issue or an abnormal running web server.
For DNS issues, we need to check whether the dns server that used by SQUID is working as expected or not.
For network issues, we might need to check network connection status, packet lost, transfer latency or something else.
To check a web server, you can send some command to its service port, usually, you can follow this command:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值