Chinaunix首页 | 论坛 | 博客
  • 博客访问: 513591
  • 博文数量: 53
  • 博客积分: 2265
  • 博客等级: 大尉
  • 技术积分: 574
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-15 16:50
文章分类

全部博文(53)

文章存档

2019年(1)

2018年(2)

2016年(2)

2015年(1)

2014年(6)

2013年(5)

2012年(7)

2011年(16)

2010年(13)

分类: BSD

2010-08-25 11:38:05

1.错误产生
 
在OpenBSD下运行了squid-2.7.STABLE6 ,代理内网上网,有人反应近来很慢,查看流量,PF连接数,发现一切正常,于是检查squid ,发现/var/squid/logs/cache.log 里有以下警告:
WARNING! Your cache is running out of filedescriptors
 
 
2.查看信息
 
于是想利用命令查看下squid的信息,输入以下命令: squidclient -p 8080 -h 127.0.0.1 mgr:info
(简单解释下语法, 参数 -p 表示我的squid用了8080端口, -h 127.0.0.1 表示查看的当前的主机),但是有误 ,无法显示正常的信息
查看squid.conf的默认的配置参数,发现
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
于是修改squid.conf,添加:
acl manager proto cache_objectacl
acl localhost src 127.0.0.1/255.255.255.255
http_access allow manager localhost
 
现在利用squidclient -p 8080 -h 127.0.0.1 mgr:info 可以看到file descriptor的信息,
File descriptor usage for squid:
        Maximum number of file descriptors:   1024
        Largest file desc currently in use:    219
 
为了增加file descriptor的数目,在配置文件squid.conf 里添加
max_filedescriptors 15000
 
后面的数目视需求而定。
 
Note: 由于不同版本的squid,有些版本里没有这个参数: max_filedescriptors 。至于如何做,请拍砖。
 
阅读(1183) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~