免费注册 查看新帖 |

Chinaunix

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

[proxy] Warning your cache is running out of file descriptor [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-28 09:37 |只看该作者 |倒序浏览
环境:CentOS 5.4 final + squid-3.0.STABLE25-1.el5(yum安装)

症状:squid 会不定时出现拒绝服务,内网无法上网,重新启动squid即可暂时解决问题,但过几天又会出现

日志:出现以上症状时,日志会出现Warning your cache is running out of file descriptor

原因:已找出原因为 文件描述 设定值太小

我知道可以通过重新编译安装来解决问题,我想问的是可否在不重新编译安装的情况下增加 文件描述 限定值呢?

google后发现有文章说可以通过如下修改squid.conf进行修改

Set max_filedesc under RHEL / Red Hat / CentOS / Fedora Linux
Stop the Squid as changes of this value isn't respected by reconfigure command. This value should be changed only if there isn't any active squid process.

# service squid stop

Open /etc/squid/squid.conf file

# vi /etc/squid/squid.conf

Append / add / modify max_filedesc directive:

max_filedesc 4096

Save and close the file. Start the squid proxy server:

# service squid start


但是我尝试了squid 3.0/3.1的版本,在squid.conf中添加max_filedesc 4096后都无法通过squid -k check的语法检查,提示如下:
  1. 2010/07/28 09:31:03| cache_cf.cc(362) parseOneConfigFile: squid.conf:2 unrecognized: 'max_filedesc'
复制代码
请教各位高手们,file descriptors的限定值到底可不可以通过squid.conf里进行设定呢?如果可以squid 3.0/3.1到底应该应该如何设定?

小弟在此先谢过啦。

论坛徽章:
0
2 [报告]
发表于 2010-08-14 14:40 |只看该作者
本帖最后由 config t 于 2010-08-14 14:41 编辑

vi /etc/profile/

增加

ulimit -n 65536 或者你想要的数字

ulimit -s 65536

重启一下系统

ulimit -a 检查一下

重新configure --增加--with-maxfd=65536或者你想的的fd

squid -Nd1 检查一下输出的fd是多少

如果系统不支持,squid.conf的maxfd的配置是不会生效的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP