SQUID-word


Quick and dirty:

Your browser is all-of-a-sudden crawling…

tail -f /var/log/squid/cache.log

2010/05/06 09:17:52| WARNING! Your cache is running out of filedescriptors
2010/05/06 09:18:08| WARNING! Your cache is running out of filedescriptors
2010/05/06 09:18:24| WARNING! Your cache is running out of filedescriptors

Ut oh…

Check what your descriptors are currently set to:

squidclient mgr:info |grep descriptors
Maximum number of file descriptors:   1024 <– maybe too small???
Available number of file descriptors: 1013
Reserved number of file descriptors:   100

/etc/init.d/squid stop

vi /etc/squid/squid.conf

do a search for the “max_filedesc” line… and change it to something like the following:

max_filedesc 4096

then

vi /etc/init.d/squid

# add this just after the comments (before any script code)

ulimit -HSn 4096 (Match this to whatever you entered in /etc/squid/squid.conf)

Start up the proxy:

/etc/init.d/squid start

Confirm your changes:

cat /var/log/squid/cache.log |grep 4096

2010/05/06 10:17:40| With 4096 file descriptors available

And that should be it… unless of course the message appears again… OR you see this:

2010/05/06 10:39:55| WARNING: All redirector processes are busy.
2010/05/06 10:39:55| WARNING: up to 117 pending requests queued
2010/05/06 10:39:55| Consider increasing the number of redirector processes to at least 122 in your config file.
2010/05/06 10:40:23| WARNING! Your cache is running out of filedescriptors
2010/05/06 10:40:29| WARNING: All redirector processes are busy.
2010/05/06 10:40:29| WARNING: up to 6 pending requests queued
2010/05/06 10:40:29| Consider increasing the number of redirector processes to at least 11 in your config file.
2010/05/06 10:40:39| WARNING! Your cache is running out of filedescriptors
2010/05/06 10:40:42| comm_open: socket failure: (24) Too many open files
2010/05/06 10:40:42| comm_open: socket failure: (24) Too many open files
2010/05/06 10:40:42| comm_open: socket failure: (24) Too many open files

So… open /etc/squid/squid.conf again, search for “redirect_children” and make a change:

#  TAG: redirect_children
#       The number of redirector processes to spawn. If you start
#       too few Squid will have to wait for them to process a backlog of
#       URLs, slowing it down. If you start too many they will use RAM
#       and other system resources.
#
#Default:
# redirect_children 5
redirect_children 50

Nice thing here is that it is giving us some idea of what to do… Thanks Squid-word 🙂

, , , , , ,

  1. Leave a comment

Leave a comment