分类: LINUX
2006-06-05 17:58:11
启动squid后,查看cache.log文件:
With 1024 file descriptors available
告诉你此squid进程可使用的file descriptors数量,像这个才1024,很容易让squid抱怨:
WARNING! Your cache is running out of filedescriptors
重新安装squid吧:
1 确保Linux系统整体能容纳的file descriptors足够多: sysctl fs.filemax=410348
2 保证shell能提供给squid足够多的file descriptors: ulimit -HSn 20480
3 修改头文件: edit /usr/include/bits/typesizes.h, set FD_SETSIZE to 20480
然后配置编译squid, 这里用的版本是2.5STABLE14
./configure,会给出一些信息:
checking Default FD_SETSIZE value... 1024
checking Maximum number of filedescriptors we can open... 1024
checking Default UDP send buffer size... 110592
checking Default UDP receive buffer size... 110592
checking Default TCP send buffer size... 16384
checking Default TCP receive buffer size... 87380
Limiting receive buffer size to 64K
你要确认是不是如你所愿! 然后编译安装就可以了
还有以后运行squid时,也要保证系统支持的file descriptors数量足够多,即上面的1和2