• 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

Simultaneous requests handled by tomcat

 
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please let me know how many requests tomcat can handle simultaneously?

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
There is a configuration variable that sets the number of Threads allocated for handling requests. One Thread handles one request/response cycle.

The last time I looked a typical value was 150. Obviously this is something that can be tuned according to what the applications require.

Bill
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your response.

Can we find it in the configuration file? Is the configuration file located somewhere in tomcat?
 
Rancher
Posts: 1044
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.../conf/server.xml
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you!!

I got it. It says 150 maximum number of threads. But the entire section has been commented out. Why is it so?
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, the stock server.xml has 2 elements which illustrate maxThreadCount.

One is for use with a named thread pool, which allows several Tomcat Connectors to share a single thread pool instead of each constructing and using their own.

The other is a maxThreadCount on the model https Connector (port 8443).

The actual maxThreadCount by default is 200, so with non-shared thread pools and having uncommented the https Connector, you'd be able to handle 200 threads coming in on port 8080 (the default) and 150 from traffic coming in on port 8443 (specified by maxThreadCount on its Connector element).

You can actually have even more concurrent incoming requests, but after the processor thread pools are exhausted, the subsequent requests queue up waiting for a free thread until the number of queue slots defined by the Connector's "acceptCount" attribute are filled. The default for acceptCount is 100. So on port 8080, by default, if you have 300 or more simultaneous requests (pool size + acceptCount queue size), the later requests will be bounced back to the client with a "connection refused" error.

This is a lot of requests, so if you even think you're in danger of exceeding that many, it's probably a good idea to set up a multi-server cluster with some sort of load-balancing. And, of course, make sure the apps spend as little time processing as possible. Definitely no long-running SQL operations in the request-handling logic, for example. Not that that's a good idea, regardless.
 
Abhimanyu Jain
Ranch Hand
Posts: 151
1
Eclipse IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for sharing this valuable information.
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic