Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 84850 invoked from network); 16 Jun 2004 09:31:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 16 Jun 2004 09:31:36 -0000 Received: (qmail 27990 invoked by uid 500); 16 Jun 2004 09:31:25 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 27362 invoked by uid 500); 16 Jun 2004 09:31:18 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 26748 invoked by uid 99); 16 Jun 2004 09:31:07 -0000 Received: from [80.91.224.249] (HELO main.gmane.org) (80.91.224.249) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 16 Jun 2004 02:31:07 -0700 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BaWkK-0005On-00 for ; Wed, 16 Jun 2004 11:30:16 +0200 Received: from 213.191.155.249 ([213.191.155.249]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Jun 2004 11:30:16 +0200 Received: from davor.cengija by 213.191.155.249 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 16 Jun 2004 11:30:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: tomcat-user@jakarta.apache.org From: Davor Cengija Subject: Too many open files on Solaris Date: Wed, 16 Jun 2004 10:59:12 +0200 Lines: 66 Message-ID: <3130613.RCrffEyhir@miki.maus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.191.155.249 User-Agent: KNode/0.7.6 Sender: news X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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