Tomcat Configuration

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

TODO

Subjects

Connector Configuration

<!-- A AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}"
           enableLookups="false" redirectPort="8443" debug="0"
           protocol="AJP/1.3"/>

For more details on Connectors, see

Tomcat Concepts - Connector

maxThreads

Make sure the value configured for maxThreads at least matches the value of mod_jk2 max_connections, configured in workers2.properties file.

keepAliveTimeout

Represents the number of milliseconds the connector (AjpProcessor instance, for example) will wait for a subsequent request before closing the connection. If not set in the configuration, Tomcat won't attempt to set it on the socket, which means the AjpProcessor instance will read from socket indefinitely.

Internally, it is implemented invoking java.net.Socket#setSoTimeout() on the associated socket. According to the Socket class documentation, the call enable/disable SO_TIMEOUT with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time. If the timeout expires, a java.net.SocketTimeoutException is raised, though the Socket is still valid. The option must be enabled prior to entering the blocking operation to have effect. The timeout must be higher than 0. A timeout of zero is interpreted as an infinite timeout.

When the timeout occurs:

  • The AjpProcessor instance is added to the recycled processor queue maintained by the AjpConnectionHandler instance
  • The underlying socket is closed
  • The Worker instance is stored as "idle"
  • curThreadsBusy is decremented

soTimeout

Has the same effect as setting 'keepAliveTimeout' above.

Also see

SO TIMEOUT

tcpNoDelay

Enable/disable TCP_NODELAY on the underlying socket. See

TCP_NODELAY

soLinger

Enable/disable SO_LINGER with the specified linger time in seconds. The maximum timeout value is platform specific. The setting only affects socket close. Also see

SO_LINGER