[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: too many open files



Achim Derigs wrote:
On Fri, Apr 02, 2004 at 05:54:48PM +0200, Thomas Jachmann wrote:

Hi,

I've got an Apache->Tomcat->Jboss setup on a Debian woody production box
(Sun JVM 1.4.2_01). Three weeks ago, Tomcat stopped working printing an
exception stating that there are too many open files. After restart, it
worked again, but only for two weeks, then it stopped again.

After searching the web, I found that this is caused by the limit on open
file descriptors on linux. A bit of research in /proc, I found that most
descriptors are open sockets. But I haven't found any solution. I find it
rather strange that my java apps (Tomcat/Jboss) spawn a few hundred
processes each and open that many files/sockets. Is this a known bug with
Tomcat or Jbosss, or can I specify some runtime arguments when starting the
VM or do I have to reconfigure my system?


Use the command `ulimit' (man sh) before you start JBoss. Possibly:

    ulimit -n unlimited

although more likely the problem is in /proc/sys/fs/file-max.

You can change it on the fly:

echo <newval> > /proc/sys/fs/file-max

also, you can set it in /etc/sysctl.conf (so it'll persist between reboots):

fs.file-max=<newvalue>

cheers,

glen



Reply to: