Chinaunix

标题: max_filedesc不起作用! [打印本页]

作者: hdcyly    时间: 2009-04-14 11:04
标题: max_filedesc不起作用!
我安装的是CentOS 5自带的squid-2.6.STABLE21-3.el5.x86_64.rpm,按道理这个包是打过REDHAT的fd补丁,支持max_filedesc参数的,
但是我在配置文件中加入“max_filedesc 8192”,重启squid之后,查看mgr:info,squid可以使用的最大FD仍然只是1024。

File descriptor usage for squid:
        Maximum number of file descriptors:   1024
        Largest file desc currently in use:     17
        Number of file desc currently in use:   14
        Files queued for open:                   0
        Available number of file descriptors: 1010
        Reserved number of file descriptors:   100
        Store Disk files open:                   0
        IO loop method:                     epoll

请问是什么原因?
作者: liuhanzhao    时间: 2009-04-14 12:00
用ulimit -n看看你系统的文件描述符是多少,如果是1024那就说明系统文件描述符没改过
更改有两种办法,1,ulimit -HSn xxxxx,但这个最好加到启动squid前,而且还跟环境有关
另外你可以google搜索一下,更改一个文件后就可以永久改过来了
作者: hdcyly    时间: 2009-04-16 16:58
原帖由 liuhanzhao 于 2009-4-14 12:00 发表
用ulimit -n看看你系统的文件描述符是多少,如果是1024那就说明系统文件描述符没改过
更改有两种办法,1,ulimit -HSn xxxxx,但这个最好加到启动squid前,而且还跟环境有关
另外你可以google搜索一下,更改一 ...


恩,确实要在启动前加上ulimit -Hsn 再配合这个参数才行。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2