wood burning stoves 2.0*
The moose likes Servlets and the fly likes Thread pool of servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Thread pool of servlet" Watch "Thread pool of servlet" New topic
Author

Thread pool of servlet

Hariom Tiwari
Greenhorn

Joined: Jun 15, 2008
Posts: 10
Hi,
Is there any way to set Thread pool size for a particular/general servlet?
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4164
    
  21

Probably not. This would generally be server dependent. On some servers you would be able to control the total number of simultaneous requests - which would define the thread pool size, or vice versa. But I don't know any that control how many threads can access a single Servlet.

Why do you want to do this?


Steve
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

I'm not sure but it looks to me as an application-specific issue.
AFAIK, JEE specification doesn't indicate such a thing.
Hariom Tiwari
Greenhorn

Joined: Jun 15, 2008
Posts: 10
just out of curiousity.
I guess there needs to be any such mechanism.In case thousands of requests come for a particular servlet ,wont performance drgrade?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
There is a mechanism limiting the number of "simultaneous" requests but it is for the servlet container as a whole.

Think about it - the container has to take a request and examine it before it knows which servlet will process it.

Inside the servlet, you can control the number of requests actually being worked on by rejecting excess requests with some sort of message.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thread pool of servlet
 
Similar Threads
Thread pool
Max number of threads in a JVM
single-threaded
Thread pool
Servlet pooling