LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /var/log/messages: Too many files open (https://www.linuxquestions.org/questions/linux-newbie-8/var-log-messages-too-many-files-open-335384/)

ThePreacherMan 06-20-2005 06:55 AM

/var/log/messages: Too many files open
 
Hi @All,

I have problems with my Linux (SuSE 9.0 Pro) - in /var/log/messages I have many messages containing "Too many files open" - this is also an error of squid. Squid doesn't open a new Webpage, getting the message "Too many ..."

Does anyone knows a solution for this problem?

paulsm4 06-21-2005 12:40 AM

Decrease /proc/sys/net/ipv4/tcp_fin_timeout?
 
The first thing you need to do is try to find out which process(es) are opening all the file handles. Is it squid? Or is squid the victim of some other process eating up resources? Your /var/log/messages file is a good place to start looking. "Lsof" can also be useful.

Once you've identified the culprit, then you need to find out what *kind* of file handles the process is eating up: disk files? threads? sockets? ("sockets" is a good guess).

Then you need to figure out what to do about it. Perhaps (depending on the resource), you can increase some operating-system limit. But more likely, you'll probably find some kind of configuration error relating to that process itself.

Assuming the culprit is "squid", and that the problem is open sockets - you might wish to decrease your TCP/IP stack's TIME_WAIT value:

/proc/sys/net/ipv4/tcp_fin_timeout

Hope that helps .. PSM

ThePreacherMan 06-21-2005 01:55 AM

Too many files ...
 
Thanks a lot, I'll try this ... :study:

chrism01 06-21-2005 02:47 AM

As well as 'lsof', have a look at 'fuser' if your system has it.

paulsm4 06-21-2005 02:58 PM

You might also increase port range
 
Hi -

Along with reducing TIME_WAIT (which reduces the time TCP/IP will wait before recycling an "ephemeral port" number, thus increasing the rate at which squid can create new connections), you might also want to:

a) increase the ephemeral port range
EXAMPLE:
echo 1024 32768 > /proc/sys/net/ipv4/ip_local_port_range


b) Modify your squid startup script to increase the #/permitted file descriptors:
EXAMPLE:
ulimit -HSn 8192

You can "google" either of these parameters for more information.

Your .. PSM


All times are GMT -5. The time now is 04:19 PM.