Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connections

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How do we specify the max connections for a web application in Tomcat...

Regards
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont think you can do that on a per-application basis without extra programming, but you can control the number of simultaneous connections. See the <Connector tag in the ../conf/server.xml file.

Bill
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the server.xml file,


<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />



Thanks William!!
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the maxThreads and acceptCount attributes of the Connector entry (HTTP Connector, if Tomcat is running as a standalone).
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

By the way:
The server.xml file that ships with Tomcat doesn't always contain all the available attributes. It relies on default values for some attributes.

The best way to see what is available is to look at the documentation provided on the Tomcat site.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic