You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lucio Capuani <lo...@gmail.com> on 2009/06/12 15:01:01 UTC

Same (virtual) machines, very different behaviour

Hello everybody and thanks for caring.

 I have an instance of Tomcat running into two Xen virtual machines.
 I have cloned one of the two virtual machines and I changed the IP
 address of the original. Now, the clone (the copy) still works fine.
 The original no more. Tomcat still start and works, but the startup
 time is endless (776637 ms, that's 12 minutes!).

 The big wait comes between these log lines:
 Jun 10, 2009 2:44:34 PM org.apache.catalina.core.StandardHost start

 and these ones (please notice the time stamp):

 Jun 10, 2009 2:57:30 PM org.apache.jk.common.ChannelSocket init
 INFO: JK: ajp13 listening on /127.0.0.1:8009

 ...so it happens when it's about to opening the socket.

 On the cloned machine, this is the output:

 Jun 10, 2009 2:44:53 PM org.apache.catalina.core.StandardHost start
 INFO: XML validation disabled
 Jun 10, 2009 2:45:09 PM org.apache.jk.common.ChannelSocket init
 INFO: JK: ajp13 listening on /127.0.0.1:8009

 there's a gap of one second among the two operations, which is of course fine.

 Please notice that all the differences between the hosts are in the IP
 address and in the fact that one's behind a firewall (the
 slow-to-start one) and the other is not. But I can't see how being
 behind a firewall can slow down opening a port on 127.0.0.1.

 That's the output I got with
 /usr/share/tomcat5.5/bin/catalina.sh debug

 Thanks so much!

 Louis Capuani

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


Re: Same (virtual) machines, very different behaviour

Posted by Mark Thomas <ma...@apache.org>.
Lucio Capuani wrote:
> Thank you for the tip.
> The interfaces are OK. Moreover, Tomcat should only bind itself on
> 127.0.0.1, so no other interface is involved. Anyhow, I can telnet
> tomcat on localhost at it's port 8009 after the socket is finally
> opened. I can also ping localhost
> 
> I even tcpdumped all the traffic occuring in those 12 minutes but I
> couldn't find anything strange.
> 
> By the way, is there some way to make tomcat record more messages
> between the two ones which are 12 minutes away? If I only could get an
> idea of what happens behind the curtains in those 12 minutes...!

Thread dumps.

Mark



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


Re: Same (virtual) machines, very different behaviour

Posted by Lucio Capuani <lo...@gmail.com>.
...even increasing the log verbosity to ALL didn't helped. There's
still this huge gap completely undocumented in the logs.
So I think I have to go the thread dump road: unfortunately I don't
have idea about how to get thorough it.

Here's what I experimented with... I found three jsvc processes
running where tomcat was in that phase of silent pause. I tried to
kill them with kill -3 PID as suggested in a website. Two of them
died; the third didn't.

I replicated this scenario twice. I could not find any file named
somehow "dump" after that.

Sorry for being so lame: any help will be greatly appreciated.

Thank you so much,
best regards.

Louis

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


Re: Same (virtual) machines, very different behaviour

Posted by Lucio Capuani <lo...@gmail.com>.
>> The interfaces are OK.
>
> The behavior indicates that may not be the case.

OK. But since I can ping them and the server answers promptly when
it's finally up - same for other servers bound to all the interfaces,
by the way: apache on the public interface, exim on localhost: all of
them works perfectly and suddenly. So: what issue could the interfaces
have?

>> Moreover, Tomcat should only bind itself on
>> 127.0.0.1, so no other interface is involved.
>
> Let's see your server.xml file.

Here it is, purged from all the (default) comments:


<Server port="8008" shutdown="SHUTDOWN">

  <!-- Comment these entries out to disable JMX MBeans support used for the
       administration web application -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
/>
  <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>

  <!-- Global JNDI resources -->
  <GlobalNamingResources>

    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
       description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />

  </GlobalNamingResources>


  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Catalina">

    <Connector port="8009" address="127.0.0.1"
               enableLookups="false" redirectPort="443" protocol="AJP/1.3"
               tomcatAuthentication="false" />


    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">


      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>


      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">

      </Host>

    </Engine>

  </Service>

</Server>

> Increase the logging level to FINE.

I did it and this is what I got :) (please notice the timestamps)

Jun 15, 2009 10:41:56 AM org.apache.catalina.startup.ContextConfig start
FINE: ======================
Jun 15, 2009 10:54:38 AM org.apache.catalina.startup.HostConfig
addWatchedResources

Thanks so much,

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


RE: Same (virtual) machines, very different behaviour

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Lucio Capuani [mailto:louis.capuani@gmail.com]
> Subject: Re: Same (virtual) machines, very different behaviour
> 
> The interfaces are OK.

The behavior indicates that may not be the case.

> Moreover, Tomcat should only bind itself on
> 127.0.0.1, so no other interface is involved.

Let's see your server.xml file.

> By the way, is there some way to make tomcat record more messages
> between the two ones which are 12 minutes away?

Increase the logging level to FINE.

> If I only could get an idea of what happens behind the 
> curtains in those 12 minutes...!

Run a CPU profiler or take several thread dumps during the period.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


Re: Same (virtual) machines, very different behaviour

Posted by Lucio Capuani <lo...@gmail.com>.
Thank you for the tip.
The interfaces are OK. Moreover, Tomcat should only bind itself on
127.0.0.1, so no other interface is involved. Anyhow, I can telnet
tomcat on localhost at it's port 8009 after the socket is finally
opened. I can also ping localhost

I even tcpdumped all the traffic occuring in those 12 minutes but I
couldn't find anything strange.

By the way, is there some way to make tomcat record more messages
between the two ones which are 12 minutes away? If I only could get an
idea of what happens behind the curtains in those 12 minutes...!

Thank you again.

Best regards,

2009/6/12, André Warnier <aw...@ice-sa.com>:
> Lucio Capuani wrote:
>> Hello everybody and thanks for caring.
>>
>>  I have an instance of Tomcat running into two Xen virtual machines.
>>  I have cloned one of the two virtual machines and I changed the IP
>>  address of the original.
>
>
> Not saying that this is necessarily the cause, but are you 100% sure
> that all your "virtualised network interfaces" stuff is correctly set up ?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: Same (virtual) machines, very different behaviour

Posted by André Warnier <aw...@ice-sa.com>.
Lucio Capuani wrote:
> Hello everybody and thanks for caring.
> 
>  I have an instance of Tomcat running into two Xen virtual machines.
>  I have cloned one of the two virtual machines and I changed the IP
>  address of the original. 


Not saying that this is necessarily the cause, but are you 100% sure 
that all your "virtualised network interfaces" stuff is correctly set up ?

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