You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Takumi Fujiwara <tr...@yahoo.com> on 2002/09/12 19:10:30 UTC

Setting thread prority in Tomcat

Hi,

Could someone please tell me if it is possible to
adjust the priority of servlet serving thread based on
which servlet it is serving?

For example, I have 2 servlets in my Web Application. 
All threads serving Servlet 1 will have higher prority
than Servlet 2. 

Can I config that in TomCat?

Thanks for any help.
Sam

__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting thread prority in Tomcat

Posted by Rodrigo Ruiz <rr...@gridsystems.com>.
See inlines :)

----- Original Message -----
From: "Tim Funk" <fu...@joedog.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, September 12, 2002 7:15 PM
Subject: Re: Setting thread prority in Tomcat


> Nope. A servlet may run in any thread. The servlet itself may adjust its
> priority (if allowed by the security manager). But you would need to
> remember to also lower it since the next request (to maybe a "normal
> servlet") to run in that thread would also run at that priority.
>

A way to do this could be with a Filter. Just set the priority to the
desired level before service is called, and return it to its original value
after servlet process.

> Personally - unless who are running a high load site and the servlet is
> cpu intensive and "long running" - I don't think you'll notice a
difference.
>

I'm not sure, but I suppose a change in servlet thread priorities could have
an important impact on performance. If the thread has higher priority than
the thread receiving requests, a CPU intensive servlet will slow the rest of
the server. Just be careful :-)

>
> Takumi Fujiwara wrote:
> > Hi,
> >
> > Could someone please tell me if it is possible to
> > adjust the priority of servlet serving thread based on
> > which servlet it is serving?
> >
> > For example, I have 2 servlets in my Web Application.
> > All threads serving Servlet 1 will have higher prority
> > than Servlet 2.
> >
> > Can I config that in TomCat?
> >
> > Thanks for any help.
> > Sam
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! News - Today's headlines
> > http://news.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 10/09/2002


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting thread prority in Tomcat

Posted by Tim Funk <fu...@joedog.org>.
Nope. A servlet may run in any thread. The servlet itself may adjust its 
priority (if allowed by the security manager). But you would need to 
remember to also lower it since the next request (to maybe a "normal 
servlet") to run in that thread would also run at that priority.

Personally - unless who are running a high load site and the servlet is 
cpu intensive and "long running" - I don't think you'll notice a difference.


Takumi Fujiwara wrote:
> Hi,
> 
> Could someone please tell me if it is possible to
> adjust the priority of servlet serving thread based on
> which servlet it is serving?
> 
> For example, I have 2 servlets in my Web Application. 
> All threads serving Servlet 1 will have higher prority
> than Servlet 2. 
> 
> Can I config that in TomCat?
> 
> Thanks for any help.
> Sam
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>