tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davor Cengija <davor.ceng...@mail.inet.hr>
Subject Re: Too many open files on Solaris
Date Wed, 23 Jun 2004 10:16:50 GMT
I've narrowed and hopefully solved the problem described below. At the end,
Solaris+Java 1.4.2+Turbine framework combination is problematic. In short,
Turbine uses resources/ui/skins/default/skin.props (on my system) file for
some configurations etc, and doesn't close it! After a while, that file is
opened 500-600 times and of course causes Too many open files exception
when Tomcat tries to open a socket. The funny thing is that my application
doesn't use the functionalities provided by skin.props; it comes
'configured' by default. Simply removing all references to it solved my Too
many open files problem.

Additionally, the same application on Linux, with the same version of Java
and Tomcat doesn't have that problem. And since I perform my tests on
Linux, it was pretty hard to find the solution.

I hope this post will eventually help somebody.

Cheers,
Davor

Davor Cengija wrote:

> My application is hitting that 'too many open files' limit on Solaris.
> 
> Jun 15, 2004 11:23:01 AM org.apache.tomcat.util.net.PoolTcpEndpoint
> acceptSocket
> SEVERE: Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]
> ignored exception: java.net.SocketException: Too many open files
> java.net.SocketException: Too many open files
>         at java.net.PlainSocketImpl.socketAccept(Native Method)
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:448)
>         at java.net.ServerSocket.accept(ServerSocket.java:419)
>         at
>
org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:107)
>         at
>
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:387)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:557)
>         at
>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
>         at java.lang.Thread.run(Thread.java:534)
> Jun 15, 2004 11:23:01 AM org.apache.tomcat.util.net.PoolTcpEndpoint
> closeServerSocket
> SEVERE: Caught exception trying to unlock accept on 8080
> java.net.SocketException: Too many open files
> Jun 15, 2004 11:23:01 AM org.apache.tomcat.util.net.PoolTcpEndpoint
> acceptSocket
> WARNING: Reinitializing ServerSocket
> 
> I realize that increasing file descriptor limit per process could help a
> bit, but my system administrator simply doesn't want to do that (since it
> requires restart).
> 
> Now, the problem is how to avoid too many open files exception. Any
> suggestions regarding Tomcat (or Apache) configuration, coding practice,
> some runtime operating system parameters would be greatly appreciated.
> 
> Here's my configuration:
> 
> Default Solaris 8 (I believe) installation on 2CPU+4GB RAM box. TCP
> connection wait timeout (I believe that the correct wording) is decreased
> from 240sec to 60sec and that's the only parameter changed on Solaris.
> 
> Tomcat 4.1.30 with j2sdk 1.4.2_04 (server mode) with Apache 2.0 as a
> proxy. Every single request goes through Apache which then routes it to
> Tomcat. 600.000 hits and cca 3GB of data daily, with peaks during working
> hours, of course, about 50.000 hits per hour. The delivered content
> consists mostly of small images (3-20k) delivered directly from a database
> (servlet sets content type etc, img src="/preview?id=123" style)
> 
> Application lives about 24hours and then dies with the exception shown
> above. As far as I can see, all input- and output- streams are flushed and
> closed, at least in my application. Cannot guarantee for the underlining
> libraries.
> 
> Somehow I think that I cannot squeeze the application anymore and that
> we're hitting tomcat+solaris limit.
> 
> Ahm... whoever managed to completelly read this rather long post I hope
> will have some suggestions.
> 
> Thanks in advance!
> 
> Cheers,
> Davor

-- 
Davor Cengija, dcengija_IQ_Filter_@inet.hr


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message