File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 12809
    
    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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Connections