[squid-users] Running out of filedescriptors

From: Carlos Mart�nez-Troncoso C. <[email protected]>
Date: Mon, 25 Sep 2006 17:39:31 -0500

Hello Squid friends.

Recently I found in my cache.log this message:
   
    WARNING! Your cache is running out of filedescriptors

I found in the same file that Squid was using 1024 filedescriptors
   
I looked for that problem in the forum and FAQ and these are my steps to
resolve that:

(I have Red Hat Enterprise 3 Update 8, kernel 2.4.21-47.ELsmp, I have
Squid installed
from squid-2.5.STABLE14-1.FC5.i386.src.rpm)

Before compile src.rpm I changed these values:
   
    ulimit -HSn 8192

In the compilation I found:

    checking for strerror... yes
    checking for initgroups... yes
    checking Default FD_SETSIZE value... 8192
    checking Maximum number of filedescriptors we can open... 8192
    checking Default UDP send buffer size... 65535
    checking Default UDP receive buffer size... 65535

I reinstalled Squid with the new rpm:
   
    rpm -Uvh --force squid-2.5.STABLE14-1.FC5.i386.rpm
   
Squid is installed fine, the binary has a new date:
   
    -rwxr-xr-x 1 root root 745108 Sep 24 08:25 /usr/sbin/squid

I changed the /etc/rc.d/init.d/squid start section:
   
    echo -n "Asignando 8192 FD y otros valores"
    echo 1024 32768 > /proc/sys/net/ipv4/ip_local_port_range
    echo 1024 > /proc/sys/net/ipv4/tcp_max_syn_backlog
    echo 8192 > /proc/sys/fs/file-max
    ulimit -HSn 8192

    echo -n $"Starting $prog: "
    $SQUID $SQUID_OPTS 2> /dev/null
    RETVAL=$?

I started Squid but in cache.log I found again:
   
    With 1024 file descriptors available
   
Which is the missing or bad step?

I was reading the spec for squid-2.5.STABLE14-1.FC5.i386.src.rpm and I
found that file has a patch
for filedescriptors (option --enable-fd-config), this is the problem or
solution?

My squid -v:
   
    Squid Cache: Version 2.5.STABLE14
    configure options: --host=i686-redhat-linux-gnu
--build=i686-redhat-linux-gnu --target=i386-redhat-linux-gnu
    --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc
    --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib
--libexecdir=/usr/libexec --localstatedir=/var
    --sharedstatedir=/usr/com --mandir=/usr/share/man
--infodir=/usr/share/info --exec_prefix=/usr
    --bindir=/usr/sbin --libexecdir=/usr/lib/squid --localstatedir=/var
--datadir=/usr/share
    --sysconfdir=/etc/squid --enable-poll --enable-snmp
--enable-removal-policies=heap,lru
    --enable-storeio=aufs,coss,diskd,null,ufs --enable-ssl
--with-openssl=/usr/kerberos --enable-delay-pools
    --enable-linux-netfilter --with-pthreads
--enable-ntlm-auth-helpers=SMB,winbind,fakeauth
    
--enable-external-acl-helpers=ip_user,ldap_group,unix_group,wbinfo_group,winbind_group

    --enable-auth=basic,digest,ntlm
--enable-digest-auth-helpers=password --with-winbind-auth-challenge
    --enable-useragent-log --enable-referer-log
--disable-dependency-tracking --enable-cachemgr-hostname=localhost
    --enable-underscores
--enable-basic-auth-helpers=LDAP,MSNT,NCSA,PAM,SMB,YP,getpwnam,multi-domain-NTLM,SASL,winbind

    --enable-cache-digests --enable-ident-lookups --with-large-files
--enable-fd-config
    --enable-follow-x-forwarded-for
   
Thanks for your help

Carlos
Received on Mon Sep 25 2006 - 16:40:02 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Oct 01 2006 - 12:00:04 MDT