LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Too many open files in system (https://www.linuxquestions.org/questions/linux-newbie-8/too-many-open-files-in-system-125960/)

ipconfig 12-15-2003 04:20 AM

Too many open files in system
 
Sometimes when I run bash scripts, it hangs for a long time, then outputs many errors starting at
/bin/bash: /bin/randomjoke: /bin/bash: bad interpreter: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
/bin/bash: cannot make pipes for command substitution: Too many open files in system
and then runs the script quite oddly.

What does Too many open files in system mean?
How can I make sure that doesn't happen?

I'm using RedHat 7.3.

hw-tph 12-15-2003 05:20 AM

It sounds like a program has spawned too many times. Check to see if you have tons and tons of some specific service or program loaded. I have had this happen to me, with Samba (and bad config files!) being the usual culprit. I just used killall smbd and killall nmbd and then the resources were freed up.


Håkan

ipconfig 12-15-2003 06:12 AM

Great, now I can't even ssh in. And that pc doesn't have a monitor and keyboard, so I'm going to have to reboot.
Is there a way to remove the limit for spawning processes, after I do that?

MartinN 12-15-2003 07:59 AM

You're on your own if you try this (I haven't done it) but the maximum number of open files is in the file
/proc/sys/fs/file-max
I believe that you could increase it by:
echo "65536" > /proc/sys/fs/file-max
Only root could do that, and it will not survive a reboot. Put it in one of the startup scripts if you want it to be persistent. But I'd say that it's just removing the symptoms of something else that's broken in your system.

Regards
Martin

ipconfig 12-15-2003 08:03 AM

What exactly is wrong?
Is it too many processes or too many io files open?
Or maybe it's something completely different?
Could I caude it to display a warning message when that number is near?

ipconfig 12-16-2003 05:14 AM

Could it be a bug in RedHat 7.3?
I get it in both my machines, both have the same things runnning except one has pppd and pppoe and the other has X. X, I noticed, starts about 30+ processes, while pppd and pppoe are two processes. Clearly, the X one has many more processees running.
Besides, file-max has 19659 in one of them, and I definitely don't have 19659 processes in any machine. It's 8192 in the other, that doesn't have over 50-100.


All times are GMT -5. The time now is 08:23 AM.