digitalnet:~ # cat /proc/sys/fs/file-max
36951
Main Topics
Browse All TopicsProxy shows this message when hangs
ep 16 11:39:23 digitalnet squid[10739]: client_side.cc(2701) WARNING! Your cache is running out of filedescriptors
Sep 16 11:39:23 digitalnet squid[10739]: comm_open: socket failure: (24) Too many open files
--------------------------
digitalnet:/etc/squid # squid -v
Squid Cache: Version 3.0.STABLE10
configure options: '--prefix=/usr' '--sysconfdir=/etc/squid' '--bindir=/usr/sbin' '--sbindir=/usr/sbin' '--localstatedir=/var' '--libexecdir=/usr/sbin' '--datadir=/usr/share/squi
--------------------------
squid is running as root
digitalnet:~ # ulimit -H
unlimited
digitalnet:~ # ulimit
unlimited
digitalnet:~ # more /proc/version
Linux version 2.6.27.21-0.1-default (geeko@buildhost) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #1 SMP 2009-03-31 14:50:44 +0200
digitalnet:~ # uname -a
Linux digitalnet 2.6.27.21-0.1-default #1 SMP 2009-03-31 14:50:44 +0200 i686 i686 i386 GNU/Linux
--------------------------
--------------------------
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I assign 65536 to var, restart squid, but still have the same problem
digitalnet:~ # sysctl fs.file-max
fs.file-max = 65536
Sep 17 20:53:06 digitalnet squid[19486]: comm_open: socket failure: (24) Too many open files
Sep 17 20:53:06 digitalnet last message repeated 3 times
Sep 17 20:53:14 digitalnet squid[19486]: ctx: enter level 0: 'http://checkurl.phishtank
Sep 17 20:53:14 digitalnet squid[19486]: http.cc(561) HttpStateData::cacheableRe
Sep 17 20:53:20 digitalnet squid[19486]: ctx: exit level 0
Sep 17 20:53:20 digitalnet squid[19486]: client_side.cc(2701) WARNING! Your cache is running out of filedescriptors
My solution come from this link
http://www.cyberciti.biz/f
Extracted from link:
Task: Find out current file descriptors limits
Login to your Squid proxy server and type the following command at shell prompt:
# squidclient mgr:info | grep 'file descri'
# squidclient -p {port} -u {proxy-user} -w '{proxy-password}' mgr:info | grep 'file descri'
# squidclient -p 8080 -u admin -w 'secretePassword' mgr:info | grep 'file descri'
Sample output:
Maximum number of file descriptors: 1024
Available number of file descriptors: 1008
Reserved number of file descriptors: 100
Squid increase the maximum file descriptors
First, update /etc/security/limits.conf file:
# vi /etc/security/limits.conf
Append following line to increase current limit from 1024 to 4096:
* - nofile 4096
Save and close the file. You must re-login to check new limits:
# ulimit -a | grep 'open files'
Sample output:
open files (-n) 4096
Next you need to set the maximum number of open file descriptors by modifying squid proxy server configuration as per your Linux distribution.
Set max_filedesc under RHEL / Red Hat / CentOS / Fedora Linux
Stop the Squid as changes of this value isn't respected by reconfigure command. This value should be changed only if there isn't any active squid process.
# service squid stop
Open /etc/squid/squid.conf file
# vi /etc/squid/squid.conf
Append / add / modify max_filedesc directive:
max_filedesc 4096
Save and close the file. Start the squid proxy server:
# service squid start
Now again run squidclient command or check log files for messages:
# squidclient mgr:info
Set max_filedesc under Ubuntu / Debian Linux
First, stop squid proxy server, enter:
# /etc/init.d/squid stop
OR
$ sudo /etc/init.d/squid stop
Open /etc/default/squid to set max. number of filedescriptors to use. You can increase this on a busy
cache to a maximum of (currently) 4096 filedescriptors. Default is 1024.
$ sudo vi /etc/default/squid
OR
# vi /etc/default/squid
Now set SQUID_MAXFD:
SQUID_MAXFD=4096
Save and close the file. Start the squid proxy server:
$ sudo /etc/init.d/squid start
Verify that it is working with new limits:
# squidclient mgr:info | grep 'file descri'
Business Accounts
Answer for Membership
by: nabeelmoiduPosted on 2009-09-17 at 08:42:34ID: 25357444
cat /proc/sys/fs/file-max