Too many open files

Problem

On a server system with GlassFish and MySQL spasmodic increase of database connections appeared continually. The GlassFish log files show up to hundred entries with the IOException Too many open files. These error occured in sporadic intervals and the problem could not be assigned to anything first.

Cause

After some time it has been detected, that this Exception is often thrown in following cases:

Solution

Long time of searching induced in the end to the File Descriptor Limit of Linux, which defines the maximum amount of simultaneously opened files and socket connections. The attempt to increase the default value 1024 to 65535 with the command ulimit failed, because the changes are not been saved permanently. Only the following two entries in limits.conf made the desired success.

Following measures has been executed to fix the problem:

* soft nofile 65535 * hard nofile 65535

After Execution of ulimit -a the new value open files 65535 will be shown.

Resources

[1] GlassFish V2 UR1
[2] /etc/security/limits.conf

Johannes Hammoud Too many open files 01.06.2008

I Coding : Community about Java programing

Language German+-

Java JSF JavaScript HTML CSS NetBeans GlassFish MySQL

Imprint

Visits
1632693
Today
431