WARNING! Your cache is running out of filedescriptors

Taking care of your Linux box.
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

WARNING! Your cache is running out of filedescriptors

Post by azfar »

I am getting this few times and my squid then stop working until I restart it.
my system:
squid 2.5 stable 14
RHEL 4

How do I know the current or default limit and where to increase it.
Azfar Hashmi
Email : azfarhashmi@hotmail.com
kbukhari
Major General
Posts: 1222
Joined: Sat Dec 31, 2005 12:29 am
Location: Lahore
Contact:

Re: WARNING! Your cache is running out of filedescriptors

Post by kbukhari »

azfar wrote:I am getting this few times and my squid then stop working until I restart it.
my system:
squid 2.5 stable 14
RHEL 4

How do I know the current or default limit and where to increase it.
define ulimit
--
Syed Kashif Ali Bukhari
+92-345-8444420
http://sysadminsline.com
http://kashifbukhari.com
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Post by azfar »

hmm did it but strange thing happen to me whenever i made changes in any following thing it revert after reboot.

/proc/sys/net/ipv4/ip_conntrack_max
/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
/proc/sys/net/ipv4/ip_local_port_range
ulimit -HSn

whats the problem ?
Azfar Hashmi
Email : azfarhashmi@hotmail.com
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

azfar wrote:hmm did it but strange thing happen to me whenever i made changes in any following thing it revert after reboot.

/proc/sys/net/ipv4/ip_conntrack_max
/proc/sys/net/ipv4/netfilter/ip_conntrack_tcp_timeout_established
you need to put the relevant entries in /etc/sysctl.conf:

Code: Select all

net.ipv4.ip_conntrack_max = whatever
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = whatever
you can't put the ulimit stuff in there, though.
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Post by azfar »

thanks for pointing it but what should I do to ulimit -HSn it also revert back after reboot.
Azfar Hashmi
Email : azfarhashmi@hotmail.com
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

ok, i searched around this, and found what you need. if your system is recent enough, it'll have a file named /etc/limits.conf or /etc/security/limits.conf. you can raise the fd limit in there (it's called "nofile").

i'd dealt with it in the past, but forgotten all about it.
Last edited by lambda on Tue Feb 13, 2007 2:24 pm, edited 1 time in total.
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Post by azfar »

yep done it and further testing.
Azfar Hashmi
Email : azfarhashmi@hotmail.com
siddiqi8
Naik
Posts: 88
Joined: Fri Feb 25, 2005 5:49 pm

Post by siddiqi8 »

i got the same issue.. i just make the ulimit to 16184 and add these lines in my squid.conf file

half_closed_clients off
server_persistent_connections off
client_persistent_connections off


after that i didn't get any error
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

don't use siddiqi8's config lines. they help his server, but don't help his users.
newbie
Company Havaldaar Major
Posts: 156
Joined: Thu Aug 08, 2002 4:18 am
Location: lahore

Post by newbie »

Theres also one more thing that squid checks maximum open files limit at compile time and saves it permanently n never checks at its startup.

So if you have tuned this limits u must recompile squid.
The RPM based squid has default 1024 limit ,built in it , IMHO.

you can confirm that what squid has picked up by checking its cache.log.

Regards
LinuxFreaK
Site Admin
Posts: 5132
Joined: Fri May 02, 2003 10:24 am
Location: Karachi
Contact:

Re:

Post by LinuxFreaK »

Dear azfar,
Salam,

FYI, http://bcr2.uwaterloo.ca/~brecht/servers/openfiles.html

Best Regards.
Farrukh Ahmed
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Post by azfar »

/proc/sys/fs/inode-nr
/proc/sys/fs/inode-state

do i need to change these files a swell
Azfar Hashmi
Email : azfarhashmi@hotmail.com
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

i don't think so. why? what have you read that tells you to change them?
azfar
Captain
Posts: 598
Joined: Tue Mar 23, 2004 1:16 am
Location: Karachi
Contact:

Post by azfar »

nothing but i found following line in another article

echo 128000 > /proc/sys/fs/inode-max

but I dont have it.
Azfar Hashmi
Email : azfarhashmi@hotmail.com
abakali
Naik
Posts: 91
Joined: Wed Jun 01, 2005 5:38 pm

Re: WARNING! Your cache is running out of filedescriptors

Post by abakali »

azfar wrote:I am getting this few times and my squid then stop working until I restart it.
my system:
squid 2.5 stable 14
RHEL 4

How do I know the current or default limit and where to increase it.
AOA
Modifying the SSH daemon to remove privilege separation for root user
or
apply ulimit from the machine not using ssh daemon
Asif Bakali !
Feel free to contact me (flames about my english and the useless of this driver will be redirected to /dev/null, oh no, it's full...).
Post Reply