Squid在Ubuntu上耗尽了文件描述符

我在Ubuntu 10.04 64bits上运行Squid 2.7.
我遇到了Squid用完文件描述符的问题,在/var/log/squid/cache.log中显示以下错误

WARNING! Your cache is running out of filedescriptors

我查了一下:

squidclient mgr:info | grep ‘file descri’

它表明我只有1024个文件描述符.

我更改了/etc/security/limits.conf,最后添加了这个:

* soft nofile 32768
* hard nofile 32768
proxy           soft    nofile          32768
proxy           hard    nofile          32768

将其添加到/etc/squid/squid.conf:

max_filedescriptors 32768

还改了/ etc / default / squid:

SQUID_MAXFD=32768

什么都没有成功.最后我编辑了/etc/init.d/squid来添加“ulimit -n 32768”:

#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.

set -e
ulimit -n 32768
<... snipped  ...>

那很有效!

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...