You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mohsen Saboorian <mo...@gmail.com> on 2009/11/14 17:49:42 UTC

Dedicated Thread Pool

Hi,

I have a web application in Tomcat 6 which goes out of thread (thread
starvation) after working some hours. Now I want to install a monitoring
tool which is a webapp itself installed inside tomcat webapp folder. Is this
possible to devote a special threadpool to one web application, so that I
can investigate what's going on through that monitoring app?

Thanks,
Mohsen

Re: Dedicated Thread Pool

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
yes, if maxThreads>minSpareThreads, then threads will be killed off and 
the pool will shrink.
and when traffic comes back, it creates new threads, with new names

Filip

On 11/19/2009 10:12 AM, Mohsen Saboorian wrote:
> Then is it normal that an executor stops and removes a thread from the pool?
>
> Mohsen
>
> On Thu, Nov 19, 2009 at 1:24 PM, Mark Thomas<ma...@apache.org>  wrote:
>
>    
>> Mohsen Saboorian wrote:
>>      
>>> I'm using Lambda Probe<http://www.lambdaprobe.org/>  to monitor threads
>>>        
>> of
>>      
>>> my Tomcat Connector. In the first few hours of Tomcat startup, threads
>>>        
>> were
>>      
>>> named http-8080-exec-1, http-8080-exec-2, etc. But now after two days, I
>>> cannot see those threads anymore. It currently has http-8080-exec-480,
>>> http-8080-exec-481, etc. How can a thread be removed from a thread pool?
>>>        
>> I
>>      
>>> can imagine a thread being suspended or waiting on a busy resource, but
>>>        
>> how
>>      
>>> can it be removed?
>>>        
>> Executors use dynamically sized thread pools. A thread can be removed by
>> stopping the thread and removing it from the pool.
>>
>> Mark
>>
>>      
>>> Mohsen
>>>
>>> On Sat, Nov 14, 2009 at 8:55 PM, Caldarale, Charles R<
>>> Chuck.Caldarale@unisys.com>  wrote:
>>>
>>>        
>>>>> From: Mohsen Saboorian [mailto:mohsens@gmail.com]
>>>>> Subject: Re: Dedicated Thread Pool
>>>>>
>>>>> Chuck, how can I bind the new<Connector>  to a different webapp
>>>>> directory?
>>>>>            
>>>> You can't, unless you create an additional<Service>  and<Engine>  -
>>>>          
>> which
>>      
>>>> is likely more trouble than it's worth.  Just use the alternate port
>>>>          
>> when
>>      
>>>> running the monitor app, and use the regular port for the other webapps.
>>>>          
>>   In
>>      
>>>> this case, obscurity (not telling users about the alternate port) is
>>>> probably sufficient.
>>>>
>>>> Again, JMX-based tools may well give you more and better information -
>>>>          
>> such
>>      
>>>> as being able to look at thread dumps on the fly.
>>>>
>>>>   - 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
>>
>>
>>      
>    


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


Re: Dedicated Thread Pool

Posted by Mohsen Saboorian <mo...@gmail.com>.
Then is it normal that an executor stops and removes a thread from the pool?

Mohsen

On Thu, Nov 19, 2009 at 1:24 PM, Mark Thomas <ma...@apache.org> wrote:

> Mohsen Saboorian wrote:
> > I'm using Lambda Probe <http://www.lambdaprobe.org/> to monitor threads
> of
> > my Tomcat Connector. In the first few hours of Tomcat startup, threads
> were
> > named http-8080-exec-1, http-8080-exec-2, etc. But now after two days, I
> > cannot see those threads anymore. It currently has http-8080-exec-480,
> > http-8080-exec-481, etc. How can a thread be removed from a thread pool?
> I
> > can imagine a thread being suspended or waiting on a busy resource, but
> how
> > can it be removed?
>
> Executors use dynamically sized thread pools. A thread can be removed by
> stopping the thread and removing it from the pool.
>
> Mark
>
> >
> > Mohsen
> >
> > On Sat, Nov 14, 2009 at 8:55 PM, Caldarale, Charles R <
> > Chuck.Caldarale@unisys.com> wrote:
> >
> >>> From: Mohsen Saboorian [mailto:mohsens@gmail.com]
> >>> Subject: Re: Dedicated Thread Pool
> >>>
> >>> Chuck, how can I bind the new <Connector> to a different webapp
> >>> directory?
> >> You can't, unless you create an additional <Service> and <Engine> -
> which
> >> is likely more trouble than it's worth.  Just use the alternate port
> when
> >> running the monitor app, and use the regular port for the other webapps.
>  In
> >> this case, obscurity (not telling users about the alternate port) is
> >> probably sufficient.
> >>
> >> Again, JMX-based tools may well give you more and better information -
> such
> >> as being able to look at thread dumps on the fly.
> >>
> >>  - 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: Dedicated Thread Pool

Posted by Mark Thomas <ma...@apache.org>.
Mohsen Saboorian wrote:
> I'm using Lambda Probe <http://www.lambdaprobe.org/> to monitor threads of
> my Tomcat Connector. In the first few hours of Tomcat startup, threads were
> named http-8080-exec-1, http-8080-exec-2, etc. But now after two days, I
> cannot see those threads anymore. It currently has http-8080-exec-480,
> http-8080-exec-481, etc. How can a thread be removed from a thread pool? I
> can imagine a thread being suspended or waiting on a busy resource, but how
> can it be removed?

Executors use dynamically sized thread pools. A thread can be removed by
stopping the thread and removing it from the pool.

Mark

> 
> Mohsen
> 
> On Sat, Nov 14, 2009 at 8:55 PM, Caldarale, Charles R <
> Chuck.Caldarale@unisys.com> wrote:
> 
>>> From: Mohsen Saboorian [mailto:mohsens@gmail.com]
>>> Subject: Re: Dedicated Thread Pool
>>>
>>> Chuck, how can I bind the new <Connector> to a different webapp
>>> directory?
>> You can't, unless you create an additional <Service> and <Engine> - which
>> is likely more trouble than it's worth.  Just use the alternate port when
>> running the monitor app, and use the regular port for the other webapps.  In
>> this case, obscurity (not telling users about the alternate port) is
>> probably sufficient.
>>
>> Again, JMX-based tools may well give you more and better information - such
>> as being able to look at thread dumps on the fly.
>>
>>  - 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: Dedicated Thread Pool

Posted by Mohsen Saboorian <mo...@gmail.com>.
I'm using Lambda Probe <http://www.lambdaprobe.org/> to monitor threads of
my Tomcat Connector. In the first few hours of Tomcat startup, threads were
named http-8080-exec-1, http-8080-exec-2, etc. But now after two days, I
cannot see those threads anymore. It currently has http-8080-exec-480,
http-8080-exec-481, etc. How can a thread be removed from a thread pool? I
can imagine a thread being suspended or waiting on a busy resource, but how
can it be removed?

Mohsen

On Sat, Nov 14, 2009 at 8:55 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Mohsen Saboorian [mailto:mohsens@gmail.com]
> > Subject: Re: Dedicated Thread Pool
> >
> > Chuck, how can I bind the new <Connector> to a different webapp
> > directory?
>
> You can't, unless you create an additional <Service> and <Engine> - which
> is likely more trouble than it's worth.  Just use the alternate port when
> running the monitor app, and use the regular port for the other webapps.  In
> this case, obscurity (not telling users about the alternate port) is
> probably sufficient.
>
> Again, JMX-based tools may well give you more and better information - such
> as being able to look at thread dumps on the fly.
>
>  - 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: Dedicated Thread Pool

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mohsen Saboorian [mailto:mohsens@gmail.com]
> Subject: Re: Dedicated Thread Pool
> 
> Chuck, how can I bind the new <Connector> to a different webapp
> directory?

You can't, unless you create an additional <Service> and <Engine> - which is likely more trouble than it's worth.  Just use the alternate port when running the monitor app, and use the regular port for the other webapps.  In this case, obscurity (not telling users about the alternate port) is probably sufficient.

Again, JMX-based tools may well give you more and better information - such as being able to look at thread dumps on the fly.

 - 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: Dedicated Thread Pool

Posted by Mohsen Saboorian <mo...@gmail.com>.
Thanks for the answers.

Chuck, how can I bind the new <Connector> to a different webapp directory?

Mohsen

On Sat, Nov 14, 2009 at 8:26 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Mohsen Saboorian [mailto:mohsens@gmail.com]
> > Subject: Dedicated Thread Pool
> >
> > Is this possible to devote a special threadpool to one web
> > application, so that I can investigate what's going on
> > through that monitoring app?
>
> Not directly.  However, you can configure an additional <Connector> for a
> different port with its own thread pool, and use that port when running the
> monitoring webapp.
>
> You can also use various JMX-based non-webapp monitoring tools such as
> JConsole and JVisualVM (both of which are available in recent Sun JDKs).
>
>  - 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: Dedicated Thread Pool

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Mohsen Saboorian [mailto:mohsens@gmail.com]
> Subject: Dedicated Thread Pool
> 
> Is this possible to devote a special threadpool to one web 
> application, so that I can investigate what's going on 
> through that monitoring app?

Not directly.  However, you can configure an additional <Connector> for a different port with its own thread pool, and use that port when running the monitoring webapp.

You can also use various JMX-based non-webapp monitoring tools such as JConsole and JVisualVM (both of which are available in recent Sun JDKs).

 - 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: Dedicated Thread Pool

Posted by Juha Laiho <Ju...@iki.fi>.
Mohsen Saboorian wrote:
> I have a web application in Tomcat 6 which goes out of thread (thread
> starvation) after working some hours. Now I want to install a monitoring
> tool which is a webapp itself installed inside tomcat webapp folder. Is this
> possible to devote a special threadpool to one web application, so that I
> can investigate what's going on through that monitoring app?


No direct answer for your question, but if you have access to the Tomcat 
server, you should be able to get quite a lot of information just by 
taking a thread dump of the running Tomcat after having it run for some 
time.
-- 
..Juha

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