You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Michael Mealling <mi...@bailey.dscga.com> on 2001/02/26 23:40:08 UTC

anyway to watch what tomcat is doing?

I have a fairly simple setup: apache 1.3.17 talking to tomcat 3.3-m1 with
just one fairly simple servlet. After only a handful of requests
have been processed the java process takes up nearly all of the CPU
in what looks like an infinite loop. I did a truss -p on the proces
which gave me this:
poll(0xEF005AC8, 0, 10)                         = 0
poll(0xEF005AC8, 0, 10)                         = 0
poll(0xEF005AC8, 0, 10)                         = 0
poll(0xEF005AC8, 0, 10)                         = 0

But that doesn't tell me much. What's the recommended way to figure
out what tomcat's up to? I've set every debug option in server.xml to 99 
but nothing shows up in the logs...

-MM

-- 
--------------------------------------------------------------------------------
Michael Mealling	|      Vote Libertarian!       | www.rwhois.net/michael
Sr. Research Engineer   |   www.ga.lp.org/gwinnett     | ICQ#:         14198821
Network Solutions	|          www.lp.org          |  michaelm@netsol.com

RE: anyway to watch what tomcat is doing?

Posted by Paulo Gaspar <pa...@krankikom.de>.
I use JBuilder 4. The foundation version is free and you can 
download it from:
  http://www.borland.com/jbuilder/foundation/

I use it in Windows but there is a Solaris (and Linux) 
version too. IMHO, this debugger is very nice to use.


Have fun,
Paulo Gaspar


> -----Original Message-----
> From: Michael Mealling [mailto:michael@bailey.dscga.com]
> Sent: Tuesday, February 27, 2001 00:10
> 
> > Can you start tomcat in a debugger, and see what happens? 
> 
> Possibly... any recommendations for which one to use?
> 


Re: anyway to watch what tomcat is doing?

Posted by Michael Mealling <mi...@bailey.dscga.com>.
On Mon, Feb 26, 2001 at 03:10:24PM -0800, cmanolache@yahoo.com wrote:
> What protocol do you use?

Ajp13

> What OS? 

Solaris 2.6...

> It's a serious problem, but hard to
> reproduce ( it never happened to me, and I'm doing all kind of requests ).

It never happened to me until I upgraded...

> Can you start tomcat in a debugger, and see what happens? 

Possibly... any recommendations for which one to use?

> Does it happens all the time ( i.e. start apache,tomcat, send 
> <100 requests and you can reproduce it) or only sometimes ?

It pretty much happens all the time. I can do about 5 requests when
the entire thing comes to a standstill at 99% CPU use...

> Can you also send your config ? 

apache 1.3.17 with mod_jk on solaris 2.6 talks via ajp13 to
tomcat 3.3-m1. Here's my server.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>

    <!-- You can add a "home" attribute to represent the "base" for
         all relative paths. If none is set, the TOMCAT_HOME property
         will be used, and if not set "." will be used.
         webapps/, work/ and log/ will be relative to this ( unless
         set explicitely to absolute paths ).
         You can also specify a "randomClass" attribute, which determines
         a subclass of java.util.Random will be used for generating session IDs.         By default this is "java.security.SecureRandom".
         Specifying "java.util.Random" will speed up Tomcat startup,
         but it will cause sessions to be less secure.
      -->
    <ContextManager debug="99" workDir="work" >

      <!-- ==================== Global modules ==================== -->

        <LogSetter name="tc_log" timestamps="true"
                   verbosityLevel="INFORMATION"  />

        <LogEvents enabled="false" />

        <!-- Backward compat: read the Context declarations from server.xml-->
        <ContextXmlReader config="conf/server.xml" />

        <!-- Separated Context -->
        <ContextXmlReader config="conf/apps.xml" />

        <AutoDeploy source="webapps" target="webapps" />

        <AutoWebApp dir="webapps" host="DEFAULT" />

        <PolicyLoader securityManagerClass="java.lang.SecurityManager"
                      policyFile="conf/tomcat.policy" />

        <SessionId cookiesFirst="true" noCookies="false" />

        <SimpleMapper1 debug="99" />


        <!-- ========== context processing modules ========== -->
        <!-- This will be the "default" profile
             ( all except the "global" modules can be set per context )
          -->
        <LogSetter name="servlet_log"
                   timestamps="true"
                   verbosityLevel = "INFORMATION"
                   path="logs/servlet-${yyyyMMdd}.log"
                   />

        <LogSetter  name="JASPER_LOG"
                   timestamps="true"
                   path="logs/jasper-${yyyyMMdd}.log"
                   verbosityLevel = "INFORMATION"  />

        <LoaderInterceptor11  useApplicationLoader="true" />

        <WebXmlReader validate="true" />

        <ErrorHandler showDebugInfo="true" />

        <WorkDirSetup cleanWorkDir="false" />

        <Jdk12Interceptor />

        <!-- Non-standard invoker, for backward compat. ( /servlet/* ) -->
        <InvokerInterceptor />

        <!-- you can add javaCompiler="jikes" -->
        <JspInterceptor keepGenerated="true"
                        largeFile="false"
                        sendErrToClient="true"
                        useJspServlet="false"
                        />

        <StaticInterceptor  debug="99" listings="true" />

        <ReloadInterceptor fullReload="true" />

        <AccessInterceptor />

        <CredentialsInterceptor />

        <SimpleRealm  filename="conf/users/global-users.xml" />

       <!-- UnComment the following and comment out the
            above to get a JDBC realm.
            Other options for driverName:
              driverName="oracle.jdbc.driver.OracleDriver"
              connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
              connectionName="scott"
              connectionPassword="tiger"

              driverName="org.gjt.mm.mysql.Driver"
              connectionURL="jdbc:mysql://localhost/authority"
              connectionName="test"
              connectionPassword="test"

            "connectionName" and "connectionPassword" are optional.
        -->
        <!--
        <JDBCRealm
            debug="99"
            driverName="sun.jdbc.odbc.JdbcOdbcDriver"
            connectionURL="jdbc:odbc:TOMCAT"
            userTable="users"
            userNameCol="user_name"
            userCredCol="user_pass"
            userRoleTable="user_roles"
            roleNameCol="role_name" />
        -->

        <LoadOnStartupInterceptor />

        <Servlet22Interceptor />

      <!-- ==================== Connectors ==================== -->

       <!-- new http adapter. Attributes:
               secure - use SSL ( https )
               keystore, keypass - certs for SSL
               port
        <Http10Interceptor port="8080"
                           secure="false"
                           maxThreads="100"
                           maxSpareThreads="50"
                           minSpareThreads="10" />
       -->
        <!--
            Uncomment this for SSL support.
            You _need_ to set up a server certificate if you want this
            to work, and you need JSSE.
            1. Add JSSE jars to CLASSPATH
            2. Edit java.home/jre/lib/security/java.security
               Add:
               security.provider.2=com.sun.net.ssl.internal.ssl.Provider
            3. Do: keytool -genkey -alias tomcat -keyalg RSA
               RSA is essential to work with Netscape and IIS.
               Use "changeit" as password. ( or add keypass attribute )
               You don't need to sign the certificate.

            You can set parameter keystore and keypass if you want
            to change the default ( user.home/.keystore with changeit )
         -->
        <!--
        <RequestInterceptor
         className="org.apache.tomcat.modules.server.Http10Interceptor"
         port="8443"
         secure="true" />
        -->
        <!--
             JNI connector, make sure that you update the native_lib
             Parameter to point to your jni_connect.dll.
         -->
        <!--
        <RequestInterceptor
         className="org.apache.tomcat.modules.server.JNIConnectionHandler"
         nativeLibrary="D:\tomcat\bin\i386\jni_connect.dll" />
         -->

        <!-- Apache AJP12 support. This is also used to shut down tomcat.
          -->
        <RequestInterceptor
         className="org.apache.tomcat.modules.server.Ajp12Interceptor"
         debug="99"
         port="8009" />

        <!-- Apache AJP13 support (mod_jk)
          -->
        <RequestInterceptor
         className="org.apache.tomcat.modules.server.Ajp13Interceptor"
         debug="99"
         port="8007" />

      <!--
           Context definitions can be placed here ( not recommended ) or
           in separate files. The ContextXmlReader will read all context
           definitions ( you can customize the "base" filename ).

           The default is conf/apps-[name].xml.

           See conf/apps-examples.xml and conf/apps-admin.xml
       -->

    </ContextManager>
</Server>


-- 
--------------------------------------------------------------------------------
Michael Mealling	|      Vote Libertarian!       | www.rwhois.net/michael
Sr. Research Engineer   |   www.ga.lp.org/gwinnett     | ICQ#:         14198821
Network Solutions	|          www.lp.org          |  michaelm@netsol.com

Re: anyway to watch what tomcat is doing?

Posted by cm...@yahoo.com.
Hi Michael,

What protocol do you use ? What OS ? It's a serious problem, but hard to
reproduce ( it never happened to me, and I'm doing all kind of requests ).

Can you start tomcat in a debugger, and see what happens ? Does it happens
all the time ( i.e. start apache,tomcat, send <100 requests and you can
reproduce it) or only sometimes ?

Can you also send your config ? 

Costin




On Mon, 26 Feb 2001, Michael Mealling wrote:

> I have a fairly simple setup: apache 1.3.17 talking to tomcat 3.3-m1 with
> just one fairly simple servlet. After only a handful of requests
> have been processed the java process takes up nearly all of the CPU
> in what looks like an infinite loop. I did a truss -p on the proces
> which gave me this:
> poll(0xEF005AC8, 0, 10)                         = 0
> poll(0xEF005AC8, 0, 10)                         = 0
> poll(0xEF005AC8, 0, 10)                         = 0
> poll(0xEF005AC8, 0, 10)                         = 0
> 
> But that doesn't tell me much. What's the recommended way to figure
> out what tomcat's up to? I've set every debug option in server.xml to 99 
> but nothing shows up in the logs...
> 
> -MM
> 
>