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 Tomcat Connector Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat Connector Question" Watch "Tomcat Connector Question" New topic
Author

Tomcat Connector Question

Quintin Paulson
Greenhorn

Joined: Sep 29, 2010
Posts: 2

I am having a problem with Tomcat6 where I cannot open more connections to the server than execute threads. My understanding is that the Listener/Acceptor is supposed to be able to manage the connections to the server and pass off the requests to the execute threads and therefore I should be able to have 100's of connections open.

Here is the current configuration of my connector:

<Connector port="8080" address="${jboss.bind.address}" maxThreads="80" maxHttpHeaderSize="8192" emptySessionPath="true" protocol="HTTP/1.1" enableLookups="false" redirectPort="8443" acceptCount="500" compression="on" compressableMimeType="text/html,text/xml,text/css,text/plain,application/x-javascript,text/javascript" connectionTimeout="20000" disableUploadTimeout="true" server="Tomcat Server 6" />


With this configuration I seemingly can only have ~60 connections open to the server at any one time.. When the server is loaded up to 60 connections, it closes the connection after every request.


Does anyone know why this happens?
Any feedback is appreciated.

Thank you


Quintin Paulson
Greenhorn

Joined: Sep 29, 2010
Posts: 2
Quintin Paulson wrote:
I am having a problem with Tomcat6 where I cannot open more connections to the server than execute threads. My understanding is that the Listener/Acceptor is supposed to be able to manage the connections to the server and pass off the requests to the execute threads and therefore I should be able to have 100's of connections open.

Here is the current configuration of my connector:

<Connector port="8080" address="${jboss.bind.address}" maxThreads="80" maxHttpHeaderSize="8192" emptySessionPath="true" protocol="HTTP/1.1" enableLookups="false" redirectPort="8443" acceptCount="500" compression="on" compressableMimeType="text/html,text/xml,text/css,text/plain,application/x-javascript,text/javascript" connectionTimeout="20000" disableUploadTimeout="true" server="Tomcat Server 6" />


With this configuration I seemingly can only have ~60 connections open to the server at any one time.. When the server is loaded up to 60 connections, it closes the connection after every request.


Does anyone know why this happens?
Any feedback is appreciated.

Thank you




I figured out the problem.. Since the default HTTP/1.1 connector is blocking, it requires a thread per socket.. This is very limiting, as the default connector does not scale well ( at least with the application I am deploying ).
For those who are not using Apache for static content I highly highly suggest switching out the connector to NIO or AJP. When using the NIO or AJP connectors you will not have this limitation. It is however trickier to tune them...


 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Tomcat Connector Question