Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Controlling servlet instances

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 361
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
B Mampilli
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cluster??? meaning??

friends dont know...
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic