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 Java 8 in Action this week in the Java 8 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...


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat Connector Question
 
Similar Threads
memory problems on the server!!!
Slow SSL connections after Tomcat 5 to 7 migration
connecting apache 2 and tomcat 7 mod_proxy_ajp configuration
Can not start Tomcat 5.0 with Windows Vista
static content (css and EXT-JS JavaScript) not found 404 (SOLVED)