我在Ubuntu 10.04 64bits上运行Squid 2.7.
我遇到了Squid用完文件描述符的问题,在/var/log/squid/cache.log中显示以下错误:
我遇到了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 ...>
那很有效!