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
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
Joined: Aug 05, 2002
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
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
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.