You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by connossieur <an...@aricent.com> on 2009/04/21 13:34:33 UTC

Problem with maximum threads

Hi,

I am using Tomcat 6.0.9 with the following server.xml config file:
     
     

The Java version I am using is JDK1.6.0_06.
The problem is with the tomcat web app being used for a load test at 200
messages/sec. The application runs well enough for half an hour but after
that time, the CPU consumption is maximum and idle is 0. Also, there are
more than 1000 threads even if I have configured the maximum threads to be
70 in the configuration. There is no problem in the application code.

Where can be the problem in the Tomcat?
Thanks,
Anand
-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

RE: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
Yes, I have already mentioned in the mail. I have that executor attributes.
:)

mgainty wrote:
> 
> 
> did you try specifying executor attribute in your Connector e.g.
> <Connector...
> executor="ThreadPool"
> ..
> />
> 
> Martin 
> ______________________________________________ 
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung /
> Note de déni et de confidentialité 
> This message is confidential. If you should not be the intended receiver,
> then we ask politely to report. Each unauthorized forwarding or
> manufacturing of a copy is inadmissible. This message serves only for the
> exchange of information and has no legal binding effect. Due to the easy
> manipulation of emails we cannot take responsibility over the the
> contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
> 
> 
>> Date: Tue, 21 Apr 2009 04:34:58 -0700
>> From: anand.bora@aricent.com
>> To: users@tomcat.apache.org
>> Subject: Problem with maximum threads
>> 
>> 
>> Hi,
>> 
>> I am using Tomcat 6.0.9 with the following server.xml config file:
>>      <Executor name="ThreadPool" namePrefix="catalina-exec-"
>>          maxThreads="70" minSpareThreads="20"/>
>>      <Connector executor="ThreadPool"
>>                 port="80" protocol="HTTP/1.1"
>>                 connectionTimeout="2000"
>>                 redirectPort="8443" />
>> 
>> The Java version I am using is JDK1.6.0_06.
>> The problem is with the tomcat web app being used for a load test at 200
>> messages/sec. The application runs well enough for half an hour but after
>> that time, the CPU consumption is maximum and idle is 0. Also, there are
>> more than 1000 threads even if I have configured the maximum threads to
>> be
>> 70 in the configuration. There is no problem in the application code.
>> 
>> Where can be the problem in the Tomcat?
>> Thanks,
>> Anand
>> -- 
>> View this message in context:
>> http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> _________________________________________________________________
> Windows Live™ Hotmail®:…more than just e-mail.
> http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_more_042009
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154518.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Problem with maximum threads

Posted by Martin Gainty <mg...@hotmail.com>.
did you try specifying executor attribute in your Connector e.g.
<Connector...
executor="ThreadPool"
..
/>

Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Tue, 21 Apr 2009 04:34:58 -0700
> From: anand.bora@aricent.com
> To: users@tomcat.apache.org
> Subject: Problem with maximum threads
> 
> 
> Hi,
> 
> I am using Tomcat 6.0.9 with the following server.xml config file:
>      <Executor name="ThreadPool" namePrefix="catalina-exec-"
>          maxThreads="70" minSpareThreads="20"/>
>      <Connector executor="ThreadPool"
>                 port="80" protocol="HTTP/1.1"
>                 connectionTimeout="2000"
>                 redirectPort="8443" />
> 
> The Java version I am using is JDK1.6.0_06.
> The problem is with the tomcat web app being used for a load test at 200
> messages/sec. The application runs well enough for half an hour but after
> that time, the CPU consumption is maximum and idle is 0. Also, there are
> more than 1000 threads even if I have configured the maximum threads to be
> 70 in the configuration. There is no problem in the application code.
> 
> Where can be the problem in the Tomcat?
> Thanks,
> Anand
> -- 
> View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 

_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_more_042009

RE: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
So, I'll take the dump and analyze and revert back.

One more confirmation. Is the executor configured by me for Tomcat
appropriate? Or should I make any more changes?

-Anand

Peter Crowther wrote:
> 
>> From: connossieur [mailto:anand.bora@aricent.com]
>> The application doesn't have problems as I tested it with
>> Visual VM (profiler for java 6) on Windows.
> 
> OK.  You've done more research than most, then - we get a lot of people
> blaming Tomcat as the first thing they do, so we tend to have some
> well-developed "check your code!" reflexes.
> 
>> Anyways, can there be problem with Tomcat?
> 
> It's pretty stable.  But no code is ever 100% guaranteed bug-free, despite
> what we might like, so there always *can* be a problem :-).
> 
> 6.0.9 is quite old now; the current version is 6.0.18, and there have been
> a number of bugfixes.  How tied are you to the old version - can you
> update and see whether that resolves the issue?
> 
>> I mean, I have limited the number of threads, still tomcat
>> spawns more than 1000 threads?
> 
> This is where that thread dump comes in.  *Something* is spawning threads
> - rather than guess what's doing it, let's get some evidence of what
> they're doing?  Then we stand a better chance of working out what's
> spawning them.
> 
>                 - Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23155063.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Problem with maximum threads

Posted by Peter Crowther <Pe...@melandra.com>.
> From: connossieur [mailto:anand.bora@aricent.com]
> The application doesn't have problems as I tested it with
> Visual VM (profiler for java 6) on Windows.

OK.  You've done more research than most, then - we get a lot of people blaming Tomcat as the first thing they do, so we tend to have some well-developed "check your code!" reflexes.

> Anyways, can there be problem with Tomcat?

It's pretty stable.  But no code is ever 100% guaranteed bug-free, despite what we might like, so there always *can* be a problem :-).

6.0.9 is quite old now; the current version is 6.0.18, and there have been a number of bugfixes.  How tied are you to the old version - can you update and see whether that resolves the issue?

> I mean, I have limited the number of threads, still tomcat
> spawns more than 1000 threads?

This is where that thread dump comes in.  *Something* is spawning threads - rather than guess what's doing it, let's get some evidence of what they're doing?  Then we stand a better chance of working out what's spawning them.

                - Peter

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


RE: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
The application doesn't have problems as I tested it with Visual VM (profiler
for java 6) on Windows. But I need the application on Linux. I'll try to
take the thread dump and see. Anyways, can there be problem with Tomcat? I
mean, I have limited the number of threads, still tomcat spawns more than
1000 threads?

Anand

Peter Crowther wrote:
> 
>> From: connossieur [mailto:anand.bora@aricent.com]
>> There is no problem in the application code.
> 
> How have you proved this?
> 
> Take a thread dump (you're on Java 1.6, so you can use jstack).  What are
> the threads doing?
> 
>                 - Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154371.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Problem with maximum threads

Posted by Peter Crowther <Pe...@melandra.com>.
> From: connossieur [mailto:anand.bora@aricent.com]
> There is no problem in the application code.

How have you proved this?

Take a thread dump (you're on Java 1.6, so you can use jstack).  What are the threads doing?

                - Peter

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


RE: Problem with maximum threads

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Stephen Caine [mailto:stephen@commongrnd.com]
> Subject: Re: Problem with maximum threads
> 
> This is the number of threads Tomcat will handle before 
> it errors with 'max threads reached.  This is on OS X, 64
> bit memory.  The heap size is 2 gigs.

Looks like the 2400 has nothing to do with Tomcat, but rather with OS X (or possibly the JVM port to OS X).  Your previous statement made no mention of OS X (or any other contributing factors), making it sound like you believed this was a Tomcat limit - which as far as I can tell it is not.

 - 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: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
Christopher,

This is my Server.xml
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at
/docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at
/docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- 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>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking &
non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
         maxThreads="70" minSpareThreads="20"/>
     <Connector executor="tomcatThreadPool"
                port="80" protocol="HTTP/1.1"
                connectionTimeout="2000"
                redirectPort="8443" />
 <!--   <Connector port="8080" protocol="HTTP/1.1" 
               maxThreads="150" connectionTimeout="20000" 
               redirectPort="8443" /> -->

    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that
processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes
them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web
applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common"
resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>

Do you think this has a problem? I'll try to upload the thread Dump to my
website and send a link.

Anand


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Stephen,
> 
> On 4/21/2009 5:35 PM, Stephen Caine wrote:
>> This is the number of threads Tomcat will handle before it errors with
>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
>> 2 gigs.
>> 
>> If you know how to increase this number, then please provide the
>> information.  Others have also noted this limit on OS X in previous
>> posts to this list.
> 
> ulimit?
> 
> On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
> switch) are set to 256. You could probably increase that by doing:
> 
> ulimit -u 1024
> 
> or whatever. If you've reached an upper limit of 2400, it's probably
> because you're reaching a hard limit set up somewhere else.
> 
> There's also:
> 
> sysctl -w kern.maxprocperuid=1024 (or more?)
> or
> sysctl -w kern.maxproc=10000 (or more?)
> 
> (My kern.maxproc is currently set to 532 -- what a strange number --
> while kern.maxprocperuid is currently 266).
> 
> You can also set your defaults in /etc/sysctl.conf:
> 
> kern.maxproc=10000
> kern.maxprocperuid=5000
> 
> I didn't know any of this before 5 minutes ago. Google is your friend.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAknuQ5wACgkQ9CaO5/Lv0PAAWgCcDkE+pxWHWYg7LgpYt+deUPqo
> ZfcAoJTtQ8RHCnWjXf127ZePRoagordH
> =CJ17
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23169991.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
Christopher,

This is my Server.xml
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at
/docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at
/docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- 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>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking &
non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
         maxThreads="70" minSpareThreads="20"/>
     <Connector executor="tomcatThreadPool"
                port="80" protocol="HTTP/1.1"
                connectionTimeout="2000"
                redirectPort="8443" />
 <!--   <Connector port="8080" protocol="HTTP/1.1" 
               maxThreads="150" connectionTimeout="20000" 
               redirectPort="8443" /> -->

    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that
processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes
them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web
applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common"
resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>

Do you think this has a problem? I'll try to upload the thread Dump to my
website and send a link.

Anand


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Stephen,
> 
> On 4/21/2009 5:35 PM, Stephen Caine wrote:
>> This is the number of threads Tomcat will handle before it errors with
>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
>> 2 gigs.
>> 
>> If you know how to increase this number, then please provide the
>> information.  Others have also noted this limit on OS X in previous
>> posts to this list.
> 
> ulimit?
> 
> On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
> switch) are set to 256. You could probably increase that by doing:
> 
> ulimit -u 1024
> 
> or whatever. If you've reached an upper limit of 2400, it's probably
> because you're reaching a hard limit set up somewhere else.
> 
> There's also:
> 
> sysctl -w kern.maxprocperuid=1024 (or more?)
> or
> sysctl -w kern.maxproc=10000 (or more?)
> 
> (My kern.maxproc is currently set to 532 -- what a strange number --
> while kern.maxprocperuid is currently 266).
> 
> You can also set your defaults in /etc/sysctl.conf:
> 
> kern.maxproc=10000
> kern.maxprocperuid=5000
> 
> I didn't know any of this before 5 minutes ago. Google is your friend.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAknuQ5wACgkQ9CaO5/Lv0PAAWgCcDkE+pxWHWYg7LgpYt+deUPqo
> ZfcAoJTtQ8RHCnWjXf127ZePRoagordH
> =CJ17
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23169992.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Problem with maximum threads

Posted by Martin Gainty <mg...@hotmail.com>.
Anand-
the suggestion of look elsewhere was a red herring

the problem is your Executor takes thread assignments e.g.
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
        maxThreads="150" minSpareThreads="4"/>

then Connector is assigned the Executor threadpool 
<Connector executor="tomcatThreadPool"..>

Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Wed, 22 Apr 2009 12:15:22 +0100
> From: p@pidster.com
> To: users@tomcat.apache.org
> Subject: Re: Problem with maximum threads
> 
> why not start by creating a backup copy of your server.xml, and then
> removing all of the commented out config.
> 
> it'll be easier to see what's going on that way...
> 
> p
> 
> 
> 
> connossieur wrote:
> > I realize that my Server.xml is not being used by the Tomcat engine. I mean
> > the Connector part.
> > Should I make any modifications anywhere?
> > 
> > And I regret for the last repeated mails. It was sent by mistake.
> > -Anand
> > 
> > connossieur wrote:
> >> Christopher,
> >>
> >> This is my Server.xml
> >> <!-- Note:  A "Server" is not itself a "Container", so you may not
> >>      define subcomponents such as "Valves" at this level.
> >>      Documentation at /docs/config/server.html
> >>  -->
> >> <Server port="8005" shutdown="SHUTDOWN">
> >>
> >>   <!--APR library loader. Documentation at /docs/apr.html -->
> >>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
> >> SSLEngine="on" />
> >>   <!--Initialize Jasper prior to webapps are loaded. Documentation at
> >> /docs/jasper-howto.html -->
> >>   <Listener className="org.apache.catalina.core.JasperListener" />
> >>   <!-- JMX Support for the Tomcat server. Documentation at
> >> /docs/non-existent.html -->
> >>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> >> />
> >>   <Listener
> >> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
> >>
> >>   <!-- Global JNDI resources
> >>        Documentation at /docs/jndi-resources-howto.html
> >>   -->
> >>   <GlobalNamingResources>
> >>     <!-- 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>
> >>
> >>   <!-- A "Service" is a collection of one or more "Connectors" that share
> >>        a single "Container" Note:  A "Service" is not itself a
> >> "Container", 
> >>        so you may not define subcomponents such as "Valves" at this level.
> >>        Documentation at /docs/config/service.html
> >>    -->
> >>   <Service name="Catalina">
> >>
> >>     <!-- A "Connector" represents an endpoint by which requests are
> >> received
> >>          and responses are returned. Documentation at :
> >>          Java HTTP Connector: /docs/config/http.html (blocking &
> >> non-blocking)
> >>          Java AJP  Connector: /docs/config/ajp.html
> >>          APR (HTTP/AJP) Connector: /docs/apr.html
> >>          Define a non-SSL HTTP/1.1 Connector on port 8080
> >>     -->
> >>      <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
> >>          maxThreads="70" minSpareThreads="20"/>
> >>      <Connector executor="tomcatThreadPool"
> >>                 port="80" protocol="HTTP/1.1"
> >>                 connectionTimeout="2000"
> >>                 redirectPort="8443" />
> >>  <!--   <Connector port="8080" protocol="HTTP/1.1" 
> >>                maxThreads="150" connectionTimeout="20000" 
> >>                redirectPort="8443" /> -->
> >>
> >>     <!-- Define a SSL HTTP/1.1 Connector on port 8443
> >>          This connector uses the JSSE configuration, when using APR, the 
> >>          connector should be using the OpenSSL style configuration
> >>          described in the APR documentation -->
> >>     <!--
> >>     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
> >>                maxThreads="150" scheme="https" secure="true"
> >>                clientAuth="false" sslProtocol="TLS" />
> >>     -->
> >>
> >>     <!-- Define an AJP 1.3 Connector on port 8009 -->
> >>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
> >>
> >>
> >>     <!-- An Engine represents the entry point (within Catalina) that
> >> processes
> >>          every request.  The Engine implementation for Tomcat stand alone
> >>          analyzes the HTTP headers included with the request, and passes
> >> them
> >>          on to the appropriate Host (virtual host).
> >>          Documentation at /docs/config/engine.html -->
> >>
> >>     <!-- You should set jvmRoute to support load-balancing via AJP ie :
> >>     <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
> >>     --> 
> >>     <Engine name="Catalina" defaultHost="localhost">
> >>
> >>       <!--For clustering, please take a look at documentation at:
> >>           /docs/cluster-howto.html  (simple how to)
> >>           /docs/config/cluster.html (reference documentation) -->
> >>       <!--
> >>       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
> >>       -->        
> >>
> >>       <!-- The request dumper valve dumps useful debugging information
> >> about
> >>            the request and response data received and sent by Tomcat.
> >>            Documentation at: /docs/config/valve.html -->
> >>       <!--
> >>       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
> >>       -->
> >>
> >>       <!-- This Realm uses the UserDatabase configured in the global JNDI
> >>            resources under the key "UserDatabase".  Any edits
> >>            that are performed against this UserDatabase are immediately
> >>            available for use by the Realm.  -->
> >>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
> >>              resourceName="UserDatabase"/>
> >>
> >>       <!-- Define the default virtual host
> >>            Note: XML Schema validation will not work with Xerces 2.2.
> >>        -->
> >>       <Host name="localhost"  appBase="webapps"
> >>             unpackWARs="true" autoDeploy="true"
> >>             xmlValidation="false" xmlNamespaceAware="false">
> >>
> >>         <!-- SingleSignOn valve, share authentication between web
> >> applications
> >>              Documentation at: /docs/config/valve.html -->
> >>         <!--
> >>         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
> >> />
> >>         -->
> >>
> >>         <!-- Access log processes all example.
> >>              Documentation at: /docs/config/valve.html -->
> >>         <!--
> >>         <Valve className="org.apache.catalina.valves.AccessLogValve"
> >> directory="logs"  
> >>                prefix="localhost_access_log." suffix=".txt"
> >> pattern="common" resolveHosts="false"/>
> >>         -->
> >>
> >>       </Host>
> >>     </Engine>
> >>   </Service>
> >> </Server>
> >>
> >> Do you think this has a problem? I'll try to upload the thread Dump to my
> >> website and send a link.
> >>
> >> Anand
> >>
> >>
> >> Christopher Schultz-2 wrote:
> > Stephen,
> > 
> > On 4/21/2009 5:35 PM, Stephen Caine wrote:
> >>>>> This is the number of threads Tomcat will handle before it errors with
> >>>>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
> >>>>> 2 gigs.
> >>>>>
> >>>>> If you know how to increase this number, then please provide the
> >>>>> information.  Others have also noted this limit on OS X in previous
> >>>>> posts to this list.
> > ulimit?
> > 
> > On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
> > switch) are set to 256. You could probably increase that by doing:
> > 
> > ulimit -u 1024
> > 
> > or whatever. If you've reached an upper limit of 2400, it's probably
> > because you're reaching a hard limit set up somewhere else.
> > 
> > There's also:
> > 
> > sysctl -w kern.maxprocperuid=1024 (or more?)
> > or
> > sysctl -w kern.maxproc=10000 (or more?)
> > 
> > (My kern.maxproc is currently set to 532 -- what a strange number --
> > while kern.maxprocperuid is currently 266).
> > 
> > You can also set your defaults in /etc/sysctl.conf:
> > 
> > kern.maxproc=10000
> > kern.maxprocperuid=5000
> > 
> > I didn't know any of this before 5 minutes ago. Google is your friend.
> > 
> > -chris
> >>>
> ---------------------------------------------------------------------
> 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
> 

_________________________________________________________________
Windows Live™ Hotmail®:…more than just e-mail.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_more_042009

Re: Problem with maximum threads

Posted by Pid <p...@pidster.com>.
why not start by creating a backup copy of your server.xml, and then
removing all of the commented out config.

it'll be easier to see what's going on that way...

p



connossieur wrote:
> I realize that my Server.xml is not being used by the Tomcat engine. I mean
> the Connector part.
> Should I make any modifications anywhere?
> 
> And I regret for the last repeated mails. It was sent by mistake.
> -Anand
> 
> connossieur wrote:
>> Christopher,
>>
>> This is my Server.xml
>> <!-- Note:  A "Server" is not itself a "Container", so you may not
>>      define subcomponents such as "Valves" at this level.
>>      Documentation at /docs/config/server.html
>>  -->
>> <Server port="8005" shutdown="SHUTDOWN">
>>
>>   <!--APR library loader. Documentation at /docs/apr.html -->
>>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
>> SSLEngine="on" />
>>   <!--Initialize Jasper prior to webapps are loaded. Documentation at
>> /docs/jasper-howto.html -->
>>   <Listener className="org.apache.catalina.core.JasperListener" />
>>   <!-- JMX Support for the Tomcat server. Documentation at
>> /docs/non-existent.html -->
>>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
>> />
>>   <Listener
>> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>>
>>   <!-- Global JNDI resources
>>        Documentation at /docs/jndi-resources-howto.html
>>   -->
>>   <GlobalNamingResources>
>>     <!-- 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>
>>
>>   <!-- A "Service" is a collection of one or more "Connectors" that share
>>        a single "Container" Note:  A "Service" is not itself a
>> "Container", 
>>        so you may not define subcomponents such as "Valves" at this level.
>>        Documentation at /docs/config/service.html
>>    -->
>>   <Service name="Catalina">
>>
>>     <!-- A "Connector" represents an endpoint by which requests are
>> received
>>          and responses are returned. Documentation at :
>>          Java HTTP Connector: /docs/config/http.html (blocking &
>> non-blocking)
>>          Java AJP  Connector: /docs/config/ajp.html
>>          APR (HTTP/AJP) Connector: /docs/apr.html
>>          Define a non-SSL HTTP/1.1 Connector on port 8080
>>     -->
>>      <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>>          maxThreads="70" minSpareThreads="20"/>
>>      <Connector executor="tomcatThreadPool"
>>                 port="80" protocol="HTTP/1.1"
>>                 connectionTimeout="2000"
>>                 redirectPort="8443" />
>>  <!--   <Connector port="8080" protocol="HTTP/1.1" 
>>                maxThreads="150" connectionTimeout="20000" 
>>                redirectPort="8443" /> -->
>>
>>     <!-- Define a SSL HTTP/1.1 Connector on port 8443
>>          This connector uses the JSSE configuration, when using APR, the 
>>          connector should be using the OpenSSL style configuration
>>          described in the APR documentation -->
>>     <!--
>>     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
>>                maxThreads="150" scheme="https" secure="true"
>>                clientAuth="false" sslProtocol="TLS" />
>>     -->
>>
>>     <!-- Define an AJP 1.3 Connector on port 8009 -->
>>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>>
>>
>>     <!-- An Engine represents the entry point (within Catalina) that
>> processes
>>          every request.  The Engine implementation for Tomcat stand alone
>>          analyzes the HTTP headers included with the request, and passes
>> them
>>          on to the appropriate Host (virtual host).
>>          Documentation at /docs/config/engine.html -->
>>
>>     <!-- You should set jvmRoute to support load-balancing via AJP ie :
>>     <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
>>     --> 
>>     <Engine name="Catalina" defaultHost="localhost">
>>
>>       <!--For clustering, please take a look at documentation at:
>>           /docs/cluster-howto.html  (simple how to)
>>           /docs/config/cluster.html (reference documentation) -->
>>       <!--
>>       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
>>       -->        
>>
>>       <!-- The request dumper valve dumps useful debugging information
>> about
>>            the request and response data received and sent by Tomcat.
>>            Documentation at: /docs/config/valve.html -->
>>       <!--
>>       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
>>       -->
>>
>>       <!-- This Realm uses the UserDatabase configured in the global JNDI
>>            resources under the key "UserDatabase".  Any edits
>>            that are performed against this UserDatabase are immediately
>>            available for use by the Realm.  -->
>>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>>              resourceName="UserDatabase"/>
>>
>>       <!-- Define the default virtual host
>>            Note: XML Schema validation will not work with Xerces 2.2.
>>        -->
>>       <Host name="localhost"  appBase="webapps"
>>             unpackWARs="true" autoDeploy="true"
>>             xmlValidation="false" xmlNamespaceAware="false">
>>
>>         <!-- SingleSignOn valve, share authentication between web
>> applications
>>              Documentation at: /docs/config/valve.html -->
>>         <!--
>>         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
>> />
>>         -->
>>
>>         <!-- Access log processes all example.
>>              Documentation at: /docs/config/valve.html -->
>>         <!--
>>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>> directory="logs"  
>>                prefix="localhost_access_log." suffix=".txt"
>> pattern="common" resolveHosts="false"/>
>>         -->
>>
>>       </Host>
>>     </Engine>
>>   </Service>
>> </Server>
>>
>> Do you think this has a problem? I'll try to upload the thread Dump to my
>> website and send a link.
>>
>> Anand
>>
>>
>> Christopher Schultz-2 wrote:
> Stephen,
> 
> On 4/21/2009 5:35 PM, Stephen Caine wrote:
>>>>> This is the number of threads Tomcat will handle before it errors with
>>>>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
>>>>> 2 gigs.
>>>>>
>>>>> If you know how to increase this number, then please provide the
>>>>> information.  Others have also noted this limit on OS X in previous
>>>>> posts to this list.
> ulimit?
> 
> On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
> switch) are set to 256. You could probably increase that by doing:
> 
> ulimit -u 1024
> 
> or whatever. If you've reached an upper limit of 2400, it's probably
> because you're reaching a hard limit set up somewhere else.
> 
> There's also:
> 
> sysctl -w kern.maxprocperuid=1024 (or more?)
> or
> sysctl -w kern.maxproc=10000 (or more?)
> 
> (My kern.maxproc is currently set to 532 -- what a strange number --
> while kern.maxprocperuid is currently 266).
> 
> You can also set your defaults in /etc/sysctl.conf:
> 
> kern.maxproc=10000
> kern.maxprocperuid=5000
> 
> I didn't know any of this before 5 minutes ago. Google is your friend.
> 
> -chris
>>>
---------------------------------------------------------------------
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: Problem with maximum threads

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: connossieur [mailto:anand.bora@aricent.com]
> Subject: Re: Problem with maximum threads
> 
> I realize that my Server.xml is not being used by the Tomcat engine.

I hope you also realize the file name must be server.xml, not Server.xml (case matters).

 - 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: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
I realize that my Server.xml is not being used by the Tomcat engine. I mean
the Connector part.
Should I make any modifications anywhere?

And I regret for the last repeated mails. It was sent by mistake.
-Anand

connossieur wrote:
> 
> Christopher,
> 
> This is my Server.xml
> <!-- Note:  A "Server" is not itself a "Container", so you may not
>      define subcomponents such as "Valves" at this level.
>      Documentation at /docs/config/server.html
>  -->
> <Server port="8005" shutdown="SHUTDOWN">
> 
>   <!--APR library loader. Documentation at /docs/apr.html -->
>   <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>   <!--Initialize Jasper prior to webapps are loaded. Documentation at
> /docs/jasper-howto.html -->
>   <Listener className="org.apache.catalina.core.JasperListener" />
>   <!-- JMX Support for the Tomcat server. Documentation at
> /docs/non-existent.html -->
>   <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> />
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
> 
>   <!-- Global JNDI resources
>        Documentation at /docs/jndi-resources-howto.html
>   -->
>   <GlobalNamingResources>
>     <!-- 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>
> 
>   <!-- A "Service" is a collection of one or more "Connectors" that share
>        a single "Container" Note:  A "Service" is not itself a
> "Container", 
>        so you may not define subcomponents such as "Valves" at this level.
>        Documentation at /docs/config/service.html
>    -->
>   <Service name="Catalina">
> 
>     <!-- A "Connector" represents an endpoint by which requests are
> received
>          and responses are returned. Documentation at :
>          Java HTTP Connector: /docs/config/http.html (blocking &
> non-blocking)
>          Java AJP  Connector: /docs/config/ajp.html
>          APR (HTTP/AJP) Connector: /docs/apr.html
>          Define a non-SSL HTTP/1.1 Connector on port 8080
>     -->
>      <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>          maxThreads="70" minSpareThreads="20"/>
>      <Connector executor="tomcatThreadPool"
>                 port="80" protocol="HTTP/1.1"
>                 connectionTimeout="2000"
>                 redirectPort="8443" />
>  <!--   <Connector port="8080" protocol="HTTP/1.1" 
>                maxThreads="150" connectionTimeout="20000" 
>                redirectPort="8443" /> -->
> 
>     <!-- Define a SSL HTTP/1.1 Connector on port 8443
>          This connector uses the JSSE configuration, when using APR, the 
>          connector should be using the OpenSSL style configuration
>          described in the APR documentation -->
>     <!--
>     <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
>                maxThreads="150" scheme="https" secure="true"
>                clientAuth="false" sslProtocol="TLS" />
>     -->
> 
>     <!-- Define an AJP 1.3 Connector on port 8009 -->
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
> 
> 
>     <!-- An Engine represents the entry point (within Catalina) that
> processes
>          every request.  The Engine implementation for Tomcat stand alone
>          analyzes the HTTP headers included with the request, and passes
> them
>          on to the appropriate Host (virtual host).
>          Documentation at /docs/config/engine.html -->
> 
>     <!-- You should set jvmRoute to support load-balancing via AJP ie :
>     <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
>     --> 
>     <Engine name="Catalina" defaultHost="localhost">
> 
>       <!--For clustering, please take a look at documentation at:
>           /docs/cluster-howto.html  (simple how to)
>           /docs/config/cluster.html (reference documentation) -->
>       <!--
>       <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
>       -->        
> 
>       <!-- The request dumper valve dumps useful debugging information
> about
>            the request and response data received and sent by Tomcat.
>            Documentation at: /docs/config/valve.html -->
>       <!--
>       <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
>       -->
> 
>       <!-- This Realm uses the UserDatabase configured in the global JNDI
>            resources under the key "UserDatabase".  Any edits
>            that are performed against this UserDatabase are immediately
>            available for use by the Realm.  -->
>       <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>              resourceName="UserDatabase"/>
> 
>       <!-- Define the default virtual host
>            Note: XML Schema validation will not work with Xerces 2.2.
>        -->
>       <Host name="localhost"  appBase="webapps"
>             unpackWARs="true" autoDeploy="true"
>             xmlValidation="false" xmlNamespaceAware="false">
> 
>         <!-- SingleSignOn valve, share authentication between web
> applications
>              Documentation at: /docs/config/valve.html -->
>         <!--
>         <Valve className="org.apache.catalina.authenticator.SingleSignOn"
> />
>         -->
> 
>         <!-- Access log processes all example.
>              Documentation at: /docs/config/valve.html -->
>         <!--
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
> directory="logs"  
>                prefix="localhost_access_log." suffix=".txt"
> pattern="common" resolveHosts="false"/>
>         -->
> 
>       </Host>
>     </Engine>
>   </Service>
> </Server>
> 
> Do you think this has a problem? I'll try to upload the thread Dump to my
> website and send a link.
> 
> Anand
> 
> 
> Christopher Schultz-2 wrote:
>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> Stephen,
>> 
>> On 4/21/2009 5:35 PM, Stephen Caine wrote:
>>> This is the number of threads Tomcat will handle before it errors with
>>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
>>> 2 gigs.
>>> 
>>> If you know how to increase this number, then please provide the
>>> information.  Others have also noted this limit on OS X in previous
>>> posts to this list.
>> 
>> ulimit?
>> 
>> On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
>> switch) are set to 256. You could probably increase that by doing:
>> 
>> ulimit -u 1024
>> 
>> or whatever. If you've reached an upper limit of 2400, it's probably
>> because you're reaching a hard limit set up somewhere else.
>> 
>> There's also:
>> 
>> sysctl -w kern.maxprocperuid=1024 (or more?)
>> or
>> sysctl -w kern.maxproc=10000 (or more?)
>> 
>> (My kern.maxproc is currently set to 532 -- what a strange number --
>> while kern.maxprocperuid is currently 266).
>> 
>> You can also set your defaults in /etc/sysctl.conf:
>> 
>> kern.maxproc=10000
>> kern.maxprocperuid=5000
>> 
>> I didn't know any of this before 5 minutes ago. Google is your friend.
>> 
>> - -chris
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>> 
>> iEYEARECAAYFAknuQ5wACgkQ9CaO5/Lv0PAAWgCcDkE+pxWHWYg7LgpYt+deUPqo
>> ZfcAoJTtQ8RHCnWjXf127ZePRoagordH
>> =CJ17
>> -----END PGP SIGNATURE-----
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23173549.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Problem with maximum threads

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anand,

On 4/22/2009 1:35 AM, connossieur wrote:
> This is my Server.xml

Note you have two connectors defined:

>      <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
>          maxThreads="70" minSpareThreads="20"/>
>      <Connector executor="tomcatThreadPool"
>                 port="80" protocol="HTTP/1.1"
>                 connectionTimeout="2000"
>                 redirectPort="8443" />

This connector uses the tomcatThreadPool executor which will use threads
with names starting with "catalina-exec-".

>     <!-- Define an AJP 1.3 Connector on port 8009 -->
>     <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

This Connector uses its own thread management, and defaults to 200 max
threads (http://tomcat.apache.org/tomcat-6.0-doc/connectors.html).

If you want the AJP connector to share the 70 threads configured above,
you need to set the "executor" attribute on this <Connector> as well.

> Do you think this has a problem? I'll try to upload the thread Dump to my
> website and send a link.

If you have 1000 threads running in your java process, than either
Tomcat has a *huge* bug (unlikely) or your application is going crazy. A
thread dump will help diagnose.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknvPjkACgkQ9CaO5/Lv0PAJcgCgiIHZ8SA7u+XvAC+31WYUi3Yp
5igAn2jlq0AXnM7jeVBAF8lWMkTVskjY
=CUNy
-----END PGP SIGNATURE-----

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


Re: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
Christopher,

This is my Server.xml
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8005" shutdown="SHUTDOWN">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at
/docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at
/docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- 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>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container", 
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking &
non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
     <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
         maxThreads="70" minSpareThreads="20"/>
     <Connector executor="tomcatThreadPool"
                port="80" protocol="HTTP/1.1"
                connectionTimeout="2000"
                redirectPort="8443" />
 <!--   <Connector port="8080" protocol="HTTP/1.1" 
               maxThreads="150" connectionTimeout="20000" 
               redirectPort="8443" /> -->

    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />


    <!-- An Engine represents the entry point (within Catalina) that
processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes
them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">         
    --> 
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

      <!-- This Realm uses the UserDatabase configured in the global JNDI
           resources under the key "UserDatabase".  Any edits
           that are performed against this UserDatabase are immediately
           available for use by the Realm.  -->
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- SingleSignOn valve, share authentication between web
applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common"
resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>

Do you think this has a problem? I'll try to upload the thread Dump to my
website and send a link.

Anand


Christopher Schultz-2 wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Stephen,
> 
> On 4/21/2009 5:35 PM, Stephen Caine wrote:
>> This is the number of threads Tomcat will handle before it errors with
>> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
>> 2 gigs.
>> 
>> If you know how to increase this number, then please provide the
>> information.  Others have also noted this limit on OS X in previous
>> posts to this list.
> 
> ulimit?
> 
> On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
> switch) are set to 256. You could probably increase that by doing:
> 
> ulimit -u 1024
> 
> or whatever. If you've reached an upper limit of 2400, it's probably
> because you're reaching a hard limit set up somewhere else.
> 
> There's also:
> 
> sysctl -w kern.maxprocperuid=1024 (or more?)
> or
> sysctl -w kern.maxproc=10000 (or more?)
> 
> (My kern.maxproc is currently set to 532 -- what a strange number --
> while kern.maxprocperuid is currently 266).
> 
> You can also set your defaults in /etc/sysctl.conf:
> 
> kern.maxproc=10000
> kern.maxprocperuid=5000
> 
> I didn't know any of this before 5 minutes ago. Google is your friend.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAknuQ5wACgkQ9CaO5/Lv0PAAWgCcDkE+pxWHWYg7LgpYt+deUPqo
> ZfcAoJTtQ8RHCnWjXf127ZePRoagordH
> =CJ17
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23169987.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Problem with maximum threads

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen,

On 4/21/2009 5:35 PM, Stephen Caine wrote:
> This is the number of threads Tomcat will handle before it errors with
> 'max threads reached.  This is on OS X, 64 bit memory.  The heap size is
> 2 gigs.
> 
> If you know how to increase this number, then please provide the
> information.  Others have also noted this limit on OS X in previous
> posts to this list.

ulimit?

On my Mac OS X 10.4.11, "ulimit -a" reports max user processes (-u
switch) are set to 256. You could probably increase that by doing:

ulimit -u 1024

or whatever. If you've reached an upper limit of 2400, it's probably
because you're reaching a hard limit set up somewhere else.

There's also:

sysctl -w kern.maxprocperuid=1024 (or more?)
or
sysctl -w kern.maxproc=10000 (or more?)

(My kern.maxproc is currently set to 532 -- what a strange number --
while kern.maxprocperuid is currently 266).

You can also set your defaults in /etc/sysctl.conf:

kern.maxproc=10000
kern.maxprocperuid=5000

I didn't know any of this before 5 minutes ago. Google is your friend.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknuQ5wACgkQ9CaO5/Lv0PAAWgCcDkE+pxWHWYg7LgpYt+deUPqo
ZfcAoJTtQ8RHCnWjXf127ZePRoagordH
=CJ17
-----END PGP SIGNATURE-----

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


Re: Problem with maximum threads

Posted by Stephen Caine <st...@commongrnd.com>.
Chuck,

This is the number of threads Tomcat will handle before it errors with  
'max threads reached.  This is on OS X, 64 bit memory.  The heap size  
is 2 gigs.

If you know how to increase this number, then please provide the  
information.  Others have also noted this limit on OS X in previous  
posts to this list.

Stephen

On Apr 21, 2009, at 9:38 AM, Caldarale, Charles R wrote:

>> From: Stephen Caine [mailto:stephen@commongrnd.com]
>> Subject: Re: Problem with maximum threads
>>
>> However, the maximum number of threads Tomcat will
>> handle is somewhere about 2400.
>
> I'm curious: where did you conjure up that number?  The actual limit  
> will vary greatly depending on platform, JVM level, heap size, heap  
> usage, and especially 32- or 64-bit environments.
>
> - 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
>


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


RE: Problem with maximum threads

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Stephen Caine [mailto:stephen@commongrnd.com]
> Subject: Re: Problem with maximum threads
> 
> However, the maximum number of threads Tomcat will 
> handle is somewhere about 2400.

I'm curious: where did you conjure up that number?  The actual limit will vary greatly depending on platform, JVM level, heap size, heap usage, and especially 32- or 64-bit environments.

 - 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: Problem with maximum threads

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: connossieur [mailto:anand.bora@aricent.com]
> Subject: RE: Problem with maximum threads
> 
> 1000 threads come up by themselves.

You're not answering the questions.  To repeat:

1) Do you really have 1,000 threads in a runnable or waiting state,
all with the names http-80-xx?

2) What makes you think you really have 1,000 threads active?

 - 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: [OT] Problem with maximum threads

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter,

On 4/21/2009 10:59 AM, Peter Crowther wrote:
>> From: Christopher Schultz [mailto:chris@christopherschultz.net]
>> Also, please post a full thread
>> dump. I want to see 1000 complete stack traces, baby.
> 
> Mmm, that's a good few kilos of carbon to shift the bits around the mailing list subscribers ;-).  Any chance of putting the thread dump on a convenient web site and posting a link?

Meh, the routers are going to be running whether he sends them via the
mailing list of not :)

Good point, though. Downloading a logfile is much better than having it
bomb your inbox.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknt4KIACgkQ9CaO5/Lv0PBCswCePbKnLLWQ9LiHH1y731LskFXf
mcgAoLT/uybY1xdfgcZ+eiDB9aekfjbC
=bZqG
-----END PGP SIGNATURE-----

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


RE: Problem with maximum threads

Posted by Peter Crowther <Pe...@melandra.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Also, please post a full thread
> dump. I want to see 1000 complete stack traces, baby.

Mmm, that's a good few kilos of carbon to shift the bits around the mailing list subscribers ;-).  Any chance of putting the thread dump on a convenient web site and posting a link?

                - Peter

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


Re: Problem with maximum threads

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anand,

On 4/21/2009 9:57 AM, connossieur wrote:
> 1000 threads come up by themselves. I have configured Tomcat to spawn only 70
> threads.

Something must be wrong. Your executor configuration:

     <Executor name="ThreadPool" namePrefix="catalina-exec-"
         maxThreads="70" minSpareThreads="20"/>

Does not match your thread dump:

RUNNABLE
"http-80-37" daemon prio=6 tid=0x0b094400 nid=0x540 runnable
[0x0c5be000..0x0c5bfb94]


Your thread names should start with "catalina-exec-", not "http-80-37".
So, one of several things is immediately evident:

1. Your executor is not being used.
2. Your thread dump is showing a thread from another <Connector>
   (not likely, since port 80 is the one being used by this connector)
3. Your server.xml isn't being used.

Can you post your entire server.xml? Also, please post a full thread
dump. I want to see 1000 complete stack traces, baby.

> Also, I'll look for synchronization issues in the code.

Synchronization issues will not create additional threads... they will
just cause race conditions and unpredictable behavior.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknt3pYACgkQ9CaO5/Lv0PCsrACeKlKIl+AlpvL9oMF0aq8m1ks1
Xi8An3czoHsotx0KH1y920SXwEfkrq8r
=ig+M
-----END PGP SIGNATURE-----

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


RE: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
1000 threads come up by themselves. I have configured Tomcat to spawn only 70
threads.
Also, I'll look for synchronization issues in the code.
:)

Caldarale, Charles R wrote:
> 
>> From: connossieur [mailto:anand.bora@aricent.com]
>> Subject: Re: Problem with maximum threads
>> 
>> Should the code I write be thread safe?
> 
> Usually.  If it's within a servlet, then it *must* be thread safe, since a
> servlet instance may handle multiple requests simultaneously.  But don't
> just blindly throw synchronizes clauses in everywhere; you only need to
> protect concurrent access to shared instances.
> 
>> RUNNABLE
>> "http-80-37" daemon prio=6 tid=0x0b094400 nid=0x540 runnable
>> [0x0c5be000..0x0c5bfb94]
> 
> Do you really have 1,000 threads in a runnable or waiting state, all with
> the names http-80-xx?  For that matter, what makes you think you really
> have 1,000 threads active?
> 
>  - 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
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23156682.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


RE: Problem with maximum threads

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: connossieur [mailto:anand.bora@aricent.com]
> Subject: Re: Problem with maximum threads
> 
> Should the code I write be thread safe?

Usually.  If it's within a servlet, then it *must* be thread safe, since a servlet instance may handle multiple requests simultaneously.  But don't just blindly throw synchronizes clauses in everywhere; you only need to protect concurrent access to shared instances.

> RUNNABLE
> "http-80-37" daemon prio=6 tid=0x0b094400 nid=0x540 runnable
> [0x0c5be000..0x0c5bfb94]

Do you really have 1,000 threads in a runnable or waiting state, all with the names http-80-xx?  For that matter, what makes you think you really have 1,000 threads active?

 - 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: Problem with maximum threads

Posted by connossieur <an...@aricent.com>.
Ya. I think I will have to re-analyze the code.
I have one doubt. Should the code I write be thread safe?

Following is the excerpt from the thread dump of different threads at
different states:

RUNNABLE
"http-80-37" daemon prio=6 tid=0x0b094400 nid=0x540 runnable
[0x0c5be000..0x0c5bfb94]
   java.lang.Thread.State: RUNNABLE
	at java.util.HashMap.getEntry(HashMap.java:347)
	at java.util.HashMap.containsKey(HashMap.java:335)
	/**This contains proprietery code **/
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- None

WAITING

"http-80-33" daemon prio=6 tid=0x0b0e5800 nid=0xfe4 in Object.wait()
[0x0c47f000..0x0c47fd94]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x03a8d630> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
	at java.lang.Object.wait(Object.java:485)
	at
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:414)
	- locked <0x03a8d630> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:440)
	at java.lang.Thread.run(Thread.java:619)

   Locked ownable synchronizers:
	- None

What do you think?
-Anand


Stephen Caine wrote:
> 
> Anand,
> 
> As others will surely tell you, there is something amiss in your  
> application that spawns threads.  However, the maximum number of  
> threads Tomcat will handle is somewhere about 2400.  So, if you are  
> getting an error at 1000 threads, look somewhere else.
> 
> Stephen Caine
> Soft Breeze Systems, LLC
> 
> On Apr 21, 2009, at 7:34 AM, connossieur wrote:
> 
>>
>> Hi,
>>
>> I am using Tomcat 6.0.9 with the following server.xml config file:
>>
>> The Java version I am using is JDK1.6.0_06.
>> The problem is with the tomcat web app being used for a load test at  
>> 200
>> messages/sec. The application runs well enough for half an hour but  
>> after
>> that time, the CPU consumption is maximum and idle is 0. Also, there  
>> are
>> more than 1000 threads even if I have configured the maximum threads  
>> to be
>> 70 in the configuration. There is no problem in the application code.
>>
>> Where can be the problem in the Tomcat?
>> Thanks,
>> Anand
>> -- 
>> View this message in context:
>> http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23156131.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Problem with maximum threads

Posted by Stephen Caine <st...@commongrnd.com>.
Anand,

As others will surely tell you, there is something amiss in your  
application that spawns threads.  However, the maximum number of  
threads Tomcat will handle is somewhere about 2400.  So, if you are  
getting an error at 1000 threads, look somewhere else.

Stephen Caine
Soft Breeze Systems, LLC

On Apr 21, 2009, at 7:34 AM, connossieur wrote:

>
> Hi,
>
> I am using Tomcat 6.0.9 with the following server.xml config file:
>
> The Java version I am using is JDK1.6.0_06.
> The problem is with the tomcat web app being used for a load test at  
> 200
> messages/sec. The application runs well enough for half an hour but  
> after
> that time, the CPU consumption is maximum and idle is 0. Also, there  
> are
> more than 1000 threads even if I have configured the maximum threads  
> to be
> 70 in the configuration. There is no problem in the application code.
>
> Where can be the problem in the Tomcat?
> Thanks,
> Anand
> -- 
> View this message in context: http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.


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