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
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Connections" Watch "Connections" New topic
Author

Connections

A Kumar
Ranch Hand

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


Java Resources at www.wbrogden.com
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 978
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
 
Similar Threads
How to get connection at each request?
Need urgent help
Sending a Broadcast ..
what is needed to find a job with java?
How long time can I keep a database connection open?