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

Postby azfar » Tue Feb 13, 2007 11:23 am

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

Postby kbukhari » Tue Feb 13, 2007 12:02 pm

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:

Postby azfar » Tue Feb 13, 2007 12:38 pm

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:

Postby lambda » Tue Feb 13, 2007 1:14 pm

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:

Postby azfar » Tue Feb 13, 2007 1:57 pm

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:

Postby lambda » Tue Feb 13, 2007 2:11 pm

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:

Postby azfar » Tue Feb 13, 2007 2:20 pm

yep done it and further testing.
Azfar Hashmi

Email : azfarhashmi@hotmail.com

siddiqi8
Naik
Posts: 88
Joined: Fri Feb 25, 2005 5:49 pm

Postby siddiqi8 » Tue Feb 13, 2007 11:57 pm

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:

Postby lambda » Wed Feb 14, 2007 2:18 am

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
Contact:

Postby newbie » Wed Feb 14, 2007 2:21 am

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:

Postby LinuxFreaK » Wed Feb 14, 2007 1:09 pm

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:

Postby azfar » Wed Feb 14, 2007 3:09 pm

/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:

Postby lambda » Wed Feb 14, 2007 3:11 pm

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:

Postby azfar » Wed Feb 14, 2007 5:06 pm

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

Postby abakali » Fri Mar 02, 2007 12:36 pm

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...).


Return to “Administration”

Who is online

Users browsing this forum: No registered users and 1 guest