Home > Programming / tutorials > What is default Connector in Tomcat 8

What is default Connector in Tomcat 8

What is the default connector option in Tomcat 8 if you do not define explicitly ?

Given this configuration in server.xml

<Connector port="8080" protocol="HTTP/1.1" enableLookups="false" compression="on"

maxThreads="200" acceptCount="100" maxKeepAliveRequests="1" URIEncoding="UTF-8" />

what do you think will be default connector ?

Answer :  NIO(Non blocking connector)

This is the screen shot from Jconsole

default-protocol-tomcat8

From Tomcat documentation

Sets the protocol to handle incoming traffic. The default value is HTTP/1.1 which uses an auto-switching mechanism to
select either a non blocking Java NIO based connector or an APR/native based connector.
If thePATH (Windows) or LD_LIBRARY_PATH (on most unix systems) environment variables contain the Tomcat native library,
the APR/native connector will be used. If the native library cannot be found, the non blocking Java based connector will be used.
Note that the APR/native connector has different settings for HTTPS than the Java connectors.

So even though you have not explicitly defined a connector, tomcat 7, tomcat 8 and above will be using NIO Connector

Now I change the server.xml connector to


<Connector port="8080" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
 maxThreads="5000" SSLEnabled="false" scheme="https" secure="true"
 socket.appReadBufSize="1024"
 socket.appWriteBufSize="1024"
 clientAuth="false" sslProtocol="TLS"
 enableLookups="false" />

tomcat-connector-protocol

The data is available through JConsole

Categories: Programming / tutorials Tags:
  1. No comments yet.
  1. No trackbacks yet.