This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat Connector Question

 
Quintin Paulson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic