This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Connections" Watch "Connections" New topic
Author

Connections

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

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

Regards
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Jul 04, 2004
Posts: 979
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

Joined: Dec 11, 2004
Posts: 13410

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.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connections