On Mon, 2012-01-23 at 06:24 -0800, gnath wrote:
> Thanks Dan and p
> 
> Sure, i will collect the thread dump once it happens again. Mean while here 
> my server.xml content related to executor and connectors:
> 
> <Executor name="tomcatThreadPool"
>                   namePrefix="catalina-exec-"
>                   maxThreads="500"
>                   minSpareThreads="50"/>
> 
>     <Connector enableLookups="false" executor="tomcatThreadPool"  port="http 
> port" protocol="HTTP/1.1"
>                connectionTimeout="20000"
>                redirectPort="https port" address="ip address"/>
> 
>     <Connector enableLookups="false" executor="tomcatThreadPool"  port="http 
> port" protocol="HTTP/1.1" SSLEnabled="true"
>                scheme="https" secure="true"
>                clientAuth="false" sslProtocol="TLS" address="ip address"
>                keystoreFile="path to cert" keystorePass="password" />
> 
> I understand what you are saying regarding the application owned threads, but 
> do they show in the access logs with the prefix i mentioned for 
> tomcatThreadPool (i saw in access logs as catalina-exec-770) ?

I do not believe that a thread with the name "catalina-exec-770" means
that there are 770 active threads.  It means that the thread you are
looking at is number 770.  The "770" is just an identifier.

>From the docs for Executor:  "The name prefix for each thread created by
the executor. The thread name for an individual thread will be
namePrefix+threadNumber".

You can get a count of the threads being used by your executor with the
following command:

  jstack <tomcat-pid> | grep "catalina-exec-" | wc


Dan

> 
> Please let me know if im missing anything or doing anything wrong in my 
> configuration. 
>  I will check on the thread dump once i collect it.
> 
> Thanks
> -G
> 
> 
> 
> ________________________________
>  From: Pid <p...@pidster.com>
> To: Tomcat Users List <users@tomcat.apache.org> 
> Sent: Monday, January 23, 2012 6:12 AM
> Subject: Re: Tomcat 6.0.35 -crossing maxThreads configured count
>  
> On 23/01/2012 14:06, Daniel Mikusa wrote:
> > On Mon, 2012-01-23 at 05:44 -0800, gnath wrote:
> >> Hi all, 
> >>
> >>
> >> We have Tomcat 6.0.35 in our production Environment running on Linux, and 
> >> we have configured to use tomcatThreadPool with maxThreads=500 and 
> >> minSpareThreads=50 with default connectionTimeout(which is 60000 sec). 
> > 
> >> We have two connectors (http and ssl) It has been giving some problems 
> >> like 'too many open files' or just hangs once in a while which requires a 
> >> restart to get back to normal. 
> > 
> > Have you taken any thread dumps when the server hangs?  What do you see?
> > 
> >>
> >>
> >> Recently i happened to check our access logs when the server hung and 
> >> stopped responding. We were printing the thread number in the logs and i 
> >> have seen the number going upto 770 (though the max is configured at 500). 
> >> I was under impression that the threads will be shared among the 
> >> connectors and max it can go to 500. Could you please explain why im 
> >> seeing very high number than configured? Is that maxThreads value per 
> >> connector?
> > 
> > It would help to see how you have your thread pool and connectors
> > configured.  Please attach your server.xml minus any comments.
> > 
> > Also, a thread dump would be nice to confirm how many threads were
> > actually running.
> 
> The maxThreads in the Connector only applies to Tomcat request
> processing threads, it is not a limit imposed on the whole JVM.
> 
> You will usually have 20-30 threads running doing various things in
> addition to those that your app starts.
> 
> If Tomcat is at 500 + 20 then the rest are likely to be started by your
> application or dependencies.  As Dan states, a thread dump is the way to
> understand this.
> 
> 
> p
> 
> 
> 
> 
> 
> -- 
> 
> [key:62590808]

Reply via email to