• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Can we control number of threads of a servlet instance

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet specification says that Only a single instance of a servlet is created by the Container at startup time. If more than one user calls that servlet, an additional thread is created to serve the request.
I just want to know that Can we limit the number of threads ? In other words If one lakh (100,000 users) access the servlet at the same time. Will one lakh threads be created.
where can we specify that servlet engine can't create threads beyond a specified limit, If possible.
If no, where can we specify to limit the number of threads ?
Thanks in advance
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Control of the number of requests that a servlet container will try to service "at one time" is what you are talking about. This varies by vendor - in Tomcat, look at the server.xml file Connector element. For example:

This says to limit the number of simultaneous requests to 75. I think the interpretation of acceptCount is that will accept that many connections but will only assign working Threads to the lesser number of 75.
Bill
 
You may have just won ten million dollars! Or, maybe a tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic