1837984 Members
2712 Online
110124 Solutions
New Discussion

Too many open files

 
Praveen Bezawada
Respected Contributor

Too many open files

Hi
We are getting 'Too many open files' exceptions when running a java application that opens sockets. Using lsof we found that the error comes when the number of open file identifier reaches 1024. This is strange because the kernel is configured to open 2048 files. The parameter that we have configured are maxfiles(2048), maxfiles_lim(2048), ncallout(2064), ulimit(nofiles 2048).
We are using HPUX11i on K380.

Any suggestions are most welcome.

...BPK...
7 REPLIES 7
Vincent Stedema
Esteemed Contributor

Re: Too many open files

Hi,

You might want to take a look at the following link: http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/configuration.html

It provides information on how to configure hp-ux for use with java.

Regards,

Vincent
Stefan Farrelly
Honored Contributor

Re: Too many open files


Your nfile parameter is still set far to low - we have to run nfile around 4000+ for java applications.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ravi_8
Honored Contributor

Re: Too many open files

Hi

for java applications nfile kernel parameter should be high.

nfiles
Maximum number of open files
This value is usually determined by the formula:
((NPROC*2)+1000)
NPROC is usually: ((MAXUSERS*5)+64)

I feel that you need to increase the nfile value.
never give up
Bill Hassell
Honored Contributor

Re: Too many open files

Use sar -v 1 to see the total file count for all processes. You may need to bump this up to 10,000, maybe 50,000 or more if you have lots of processes opening thousands of files. (however, I would question the design of the application--opening thousands of files at the same time sounds like an expedient to avoid using a real database)


Bill Hassell, sysadmin
Praveen Bezawada
Respected Contributor

Re: Too many open files

Hi
The nfile is set at 114548.
The ulimit(nofiles 2048) is the user limitation in the shell.

...BPK...
Niraj Kumar Verma
Trusted Contributor

Re: Too many open files

Hi,

I have seen this situation when the user account runs out of file descriptors.

You can increase file descriptors if you have enough privileges with the ulimit command

# ulimit

-Niraj
Niraj.Verma@philips.com
Niraj Kumar Verma
Trusted Contributor

Re: Too many open files

Hi,

can you look at this URL

http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1/configuration.html

and also check

# ulimit -a

Regards
Niraj
Niraj.Verma@philips.com