This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Controlling servlet instances Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Controlling servlet instances" Watch "Controlling servlet instances" New topic
Author

Controlling servlet instances

B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
Hi all,
If I have a servlet by the name of HelloServlet.java, normally only one instance of this servlet would handle all the client requests. If the number of requests made to this servlet is very high, then where do I specify that there should be 5 instances of this servlet on the server side handling the client request?
Do I specify this in the web.xml or in the server.xml or somewhere else?
Boney
Howard Kushner
author
Ranch Hand

Joined: Sep 19, 2003
Posts: 361
Basically you don't. How high is very high? If very high means like thousands or tens of thousands of requests per second then scale the runtime architecture. Did I misunderstand something in your original question? You don't generally want more than a single instance of a servlet in any given web container. That's what threads are for.


Howard Kushner<br />IBM Certified Enterprise Developer - WebSphere Studio Application Developer V5.0<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - Web Services with WebSphere Studio V5.1<br /><a href="http://www.amazon.com/exec/obidos/tg/detail/-/1931182108/" target="_blank" rel="nofollow">Developing J2EE Applications with WebSphere Studio</a> my Certification Study Guide for IBM Test 287
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
Yes, something like a 10000 requests per second...
Something like a servlet for database access or something..
in that case i feel that having multiple servlet instances would help...
You said that we should scale the runtime architecture. How do we do that??
some friends told me that there is some specific tag that needs to be specified in the web.xml or server.xml.... is there anything like this??
or is the instance creation completely server implementation dependent?? and the programmer has no control over that..
Please clarify..
Boney
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
You said that we should scale the runtime architecture. How do we do that??
cluster
some friends told me that there is some specific tag that needs to be specified in the web.xml or server.xml.... is there anything like this??
the only one I can think of is <distributable/> tag. Ask your friends and let us know .


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
B Mampilli
Ranch Hand

Joined: Aug 05, 2002
Posts: 61
cluster??? meaning??

friends dont know...
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,

If you find that the number of requests are more then go for Server clustering which will take care the load balancing. The basic idea is two or three managed servers will be administrated by one Administration Server which will redirect the servlet request depends on the loads to the various server. Just check your application server manual for this Server clustering details.
On the other hand if you use 5 servlet instances how will handle the transaction and other details.
Regards,
M.S.Raman.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Controlling servlet instances
 
Similar Threads
how many instances???
Some Clarification about servlet ??
Is it the container or the Thread??
Struts jsps in WEB-INF
new browser detection