← Back to team overview

dhis2-users team mailing list archive

Re: Too Many Open Files?

 

Hi Jason,

‘Files’ in this context is really a file descriptor, which is any
connectable resource in the system, including both files and sockets.

I do agree that it’s unlikely that Tomcat hogs 6.5 million FDs, but I’m not
convinced that is the real limit either.

You could try:

ulimit -n

To get the max for open file descriptors in the system.

You can check max FDs for the Tomcat process by running:

cat /proc/<pid-of-tomcat>/limits

Which is usually around 1024.

Also this
<https://www.jayway.com/2012/02/11/how-to-really-fix-the-too-many-open-files-problem-for-tomcat-in-ubuntu/>
might be useful.

Lastly, if the limits are sane (which they probably are) and you are able
to reproduce the issue you could try using this tool
<http://file-leak-detector.kohsuke.org/> to pinpoint the problem.
(Disclaimer: I have no experience with it).
​

On Mon, Sep 5, 2016 at 11:22 PM, Jason Phillips <jason@xxxxxxxx> wrote:

> Hi all,
>
>
>
> We have a system that tanked last night, reporting:
>
>
>
> 14-Aug-2016 19:13:57.440 SEVERE [http-nio-8080-Acceptor-0]
> org.apache.tomcat.util.net.NioEndpoint$Acceptor.run Socket accept failed
>
> java.io.IOException: Too many open files
>
> at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
>
> at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:
> 422)
>
> at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:
> 250)
>
> at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(
> NioEndpoint.java:687)
>
> at java.lang.Thread.run(Thread.java:745)
>
>
>
> Any ideas what the cause might be?  The environment is Ubuntu 14.04,
> Tomcat 8, Java 8.
>
> A cat /proc/sys/fs/file-max returns 6556412 – and that system was
> physically restarted within the last week.  I find it hard to believe that
> the web server would have 6,5 million files open in such a short period of
> time.
>
> War is 2.23
>
> OS is Ubuntu 14.04 LTS
>
> Tomcat 8
>
> Java 8
>
>
>
> Kind Regards,
>
> *Jason Phillips*
>
> [image: hisp]
> *Information Systems / Infrastructure*
>
> *Health Information Systems Program____________________________________*
>
> eMail:               jason@xxxxxxxx
> Tel/Fax:            +27 21 712 0170
> Cell:                 +27 72 973 7250
> Skype:             jason.n.phillips
>
> This message and any attachments are subject to a disclaimer published at
> http://www.hisp.org/policies.html#comms_disclaimer.  Please read the
> disclaimer before opening any attachment or taking any other action in
> terms of this electronic transmission.  If you cannot access the
> disclaimer, kindly send an email to disclaimer@xxxxxxxx and a copy will
> be provided to you. By replying to this e-mail or opening any attachment
> you agree to be bound by the provisions of the disclaimer.
>
>
>
> *This message and any attachments are subject to a disclaimer published at
> http://www.hisp.org/policies.html#comms_disclaimer
> <http://www.hisp.org/policies.html#comms_disclaimer>.  Please read the
> disclaimer before opening any attachment or taking any other action in
> terms of this electronic transmission.  If you cannot access the
> disclaimer, kindly send an email to disclaimer@xxxxxxxx
> <disclaimer@xxxxxxxx> and a copy will be provided to you. By replying to
> this e-mail or opening any attachment you agree to be bound by the
> provisions of the disclaimer.*
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Halvdan Hoem Grelland
Software developer, DHIS 2
University of Oslo
http://www.dhis2.org <https://www.dhis2.org/>

PNG image


Follow ups

References