wood burning stoves
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


A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 980

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

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13035
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.

A Kumar
Ranch Hand

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

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).

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
It's not a secret anymore!