squid Your cache is running out of filedescriptors

squid 3.0 访问网站一时好,一时卡主

检查 /var/log/squid/cache.log

出现:

 

WARRNING: Your cache is running out of filedescriptors

的原因是因为

squid 的

Maximum number of file descriptors过小,默认为:1024

/usr/local/squid/bin/squidclient -p 80 -h localhost mgr:info (进行查看)

 

解决方法:

修改系统的 

 

#ulimit -HSn 32768 (因为本次修改在系统重启后会失效,所以修改一下文件)

 

 

/etc/security/limits.conf

在最后添加:

* soft nofile 32768 (或65536)

* hard nofile 32768 (或65536)

 

这样系统重启后相关参数也会生效

 

现在重启 squid

#service squid restart

 

重启squid 后查看 

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

找到

File descriptor usage for squid:
        Maximum number of file descriptors:   16384
        Largest file desc currently in use:     95
        Number of file desc currently in use:   64
        Files queued for open:                   0
        Available number of file descriptors: 14936
        Reserved number of file descriptors:   100
        Store Disk files open:                   0

 

这样问题就解决了!

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值