Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 66073 invoked from network); 24 Feb 2009 20:58:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Feb 2009 20:58:35 -0000 Received: (qmail 90301 invoked by uid 500); 24 Feb 2009 20:58:23 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 90281 invoked by uid 500); 24 Feb 2009 20:58:23 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 90270 invoked by uid 99); 24 Feb 2009 20:58:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 12:58:23 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [195.156.147.13] (HELO jenni2.inet.fi) (195.156.147.13) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2009 20:58:15 +0000 Received: from ichaos.ichaos-int (88.195.115.158) by jenni2.inet.fi (8.5.014) id 48FC5A88057D0EC9 for users@tomcat.apache.org; Tue, 24 Feb 2009 22:57:53 +0200 Received: from [127.0.0.1] (chaos.ichaos-int [192.168.105.33]) by ichaos.ichaos-int (Postfix) with ESMTP id 0509861FD for ; Tue, 24 Feb 2009 22:57:52 +0200 (EET) Message-ID: <49A45F53.9060508@iki.fi> Date: Tue, 24 Feb 2009 22:57:55 +0200 From: Juha Laiho User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: very slow class loading on initial JSP/servlet request after restart References: <499DEA05.4040501@ims.net> <499EB1D6.7020302@christopherschultz.net> <499ED728.4080909@ims.net> In-Reply-To: <499ED728.4080909@ims.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 090224-0, 24.02.2009), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org So, looks like I'm late to the party, but will crash in nonetheless. Sam Hokin wrote: > Christopher Schultz wrote: >> On 2/19/2009 6:23 PM, Sam Hokin wrote: >>> The problem, which spontaneously appeared a few days before Christmas on >>> this one server, is that the initial request of a JSP or servlet takes >>> AGES to respond, usually exceeding several minutes. > > Well, I have used a number of diagnostics, like jconsole, jstat and > jhat, but haven't been able to glean anything informative from them > about my issue. I've run the -Xloggc JVM option, and watched it garbage > collect, again not informing me of anything. Yes, if I could figure out > what the JVM is actually DOING doing the long wait, I'd hopefully be > able to deal with it, but I honestly haven't been able to figure out how > to do that. What do you suggest? > >> I'll cast my hat into the ring: I suspect you're loading a resource that >> wants to looking an external resource (like an XML file with a remote >> DTD/Schema and validation is on in the parser) and the DNS is tripping >> you up. > > No, there are no external references in my Java package. It's all just > local class files. Still it sounds like a network (DNS) issue, but it does not pay to just argue, more information is needed. One tool that I haven't yet seen suggested is 'strace', the Linux system call tracer. This will show all the calls your application makes to the operating system. As you say the application is mostly idle during the delay, it is, in one way or another, waiting for some OS service to complete. 'strace' should provide you with timestamped information on what OS services were called, with which arguments, and how long did it take for them to return with results. 'strace' will leave you with a huge file (or a set of huge files, depending on the options you use), and going through them will take some time - but you'll most likely also find what causes the delay. If you decide to go this way, trim down your application to the minimum where you can still see the delay; with this you hopefully can get at least some reduction to the amount of log data written. Even though it is possible to temporarily attach strace to a running process (like the Tomcat at the moment when it is hung), I'd recommend starting the tomcat under truss (with -f or -ff to make it also trace new processes created), because this way it is easier to trace back the file descriptor numbers accessed. -- ..Juha --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org