users@glassfish.java.net

Re: "Too many open files" error in Linux

From: Glenn Holmer <gholmer_at_weycogroup.com>
Date: Thu, 03 Jun 2010 08:03:13 -0500

On Thu, 2010-06-03 at 01:18 -0700, glassfish_at_javadesktop.org wrote:
> My Glassfish works on Linux.
> I have 3 simultaneous domains.
>
> Often when I start domain it throws
> >> java.io.IOException: Too many open files
>
> What should I do to get rid of it ?

This is what we did (assuming GlassFish runs as user "glassfish"):

Add the following lines to /etc/security/limits.conf to increase the
maximum number of open files for the user that Glassfish runs as:

glassfish soft nofile 32768
glassfish hard nofile 65536

You will also need to add this line in /etc/pam.d/su:

session required pam_limits.so

-- 
____________________________________________________________
Glenn Holmer                          gholmer_at_weycogroup.com
Software Engineer                        phone: 414-908-1809
Weyco Group, Inc.                          fax: 414-908-1601