免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 12453 | 回复: 11
打印 上一主题 下一主题

[proxy] 请问squid命中率怎么看? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-18 14:10 |只看该作者 |正序浏览
[root@localhost bin]# ./squidclient mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
我装的是squid2.6,端口是默认的3128.请问命中率怎么看?先谢谢了!

论坛徽章:
0
12 [报告]
发表于 2009-07-06 00:55 |只看该作者
兄弟:我终于找到解决方法了,此方法解决多虚拟IP地址监控3128端口的命中率查询的方法。

在squid配置里加一条

http_port 127.0.0.1:3128

论坛徽章:
0
11 [报告]
发表于 2009-02-13 15:14 |只看该作者
挖坟,呵呵。
第一次用时候,不小心也碰到这个问题,很巧,搜到这个帖子,遗憾是当时没搞明白。
后来搞定了,总结下,希望对后来者有益:
先看下squidclient的用法帮助,系统显示的,
Usage: /usr/local/squid/bin/squidclient [-arsv] [-i IMS] [-h remote host] [-l local host] [-p port] [-m method] [-t count] [-I ping-interval] [-H 'strings'] [-T timeout] url
注意-h、-l、-p三个参数。说明已经很明白了,分别是远程主机、本地主机、端口。
-l localhost,应该是本地套接字;-h remote host连接的是tcp/ip套接字。
楼主在2楼能够client: bind: Success.,据我估计,应该是可以的。
只需netstat看下squid是在哪个ip:port上监听的,-l 换成-h ip -p port就可以了。
所以我楼上前辈的回答,应该是帮楼主解决了问题吧。

据我这里看,squid并不在localhost(127.0.0.1)监听的,不知道他-l参数干嘛用的。

论坛徽章:
0
10 [报告]
发表于 2007-12-15 17:26 |只看该作者

配置虚拟主机了么?

试试这样:
squid]$ /usr/local/squid/bin/squidclient -h www.forum.com -p 80 mgr:info

论坛徽章:
0
9 [报告]
发表于 2007-06-19 22:58 |只看该作者
acl manager proto cache_objectacl
acl localhost src 127.0.0.1/255.255.255.255
http_access allow Manager localhost

# /usr/local/squid/bin/squidclient -p 80 -h localhost mgr:info

端口改成你http_port设置的端口

论坛徽章:
0
8 [报告]
发表于 2007-06-19 16:06 |只看该作者
先谢谢各位的帮忙,但问题还没有解决
acl manager proto cache_objectacl
acl localhost src 127.0.0.1/255.255.255.255
acl localhost src 10.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
http_access allow Manager localhost
我加了acl localhost src 10.0.0.1/255.255.255.255后也不行,去掉acl localhost src 127.0.0.1/255.255.255.255也不行,请问跟这行"acl to_localhost dst 127.0.0.0/8"有关吗?

论坛徽章:
0
7 [报告]
发表于 2007-06-19 13:01 |只看该作者
acl Manager proto cache_object
http_access allow Manager localhost

论坛徽章:
0
6 [报告]
发表于 2007-06-19 09:55 |只看该作者
这试过了,这样也不行.
http_port 10.0.0.1:3128
./squidclient -l 10.0.0.1 mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
./squidclient -l 10.0.0.1:3128 mgr:info
client: bind: Success
./squidclient -l 10.0.0.1 -p 3128 mgr:info
client: ERROR: Cannot connect to localhost:3128: Connection refused
请问还有什么办法吗?

论坛徽章:
0
5 [报告]
发表于 2007-06-19 09:21 |只看该作者
试试 squidclient -l 10.0.0.1 mgr:info

论坛徽章:
0
4 [报告]
发表于 2007-06-18 15:44 |只看该作者
squid.conf
http_port 10.0.0.1:3128
用./squidclient -p 3128 mgr:info
报client: ERROR: Cannot connect to localhost:3128: Connection refused
用./squidclient -l 10.0.0.1:3128 mgr:info
报client: bind: Success
我把squid.conf 改为
http_port 3128
./squidclient mgr:info
就没有问题,能直接看到结果
请问我要在http_port 后加IP的话要怎样才能看mgr:info?
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP