Skip to content

Tomcat

Martini Server Runtime includes Apache Tomcat for serving all HTTP requests. To optimize its performance, you can tune the Tomcat settings.

Properties related to the HTTP connector in Martini's Tomcat can be adjusted using Martini Server Runtime application properties. Use either server.tomcat.http or server.tomcat.https prefix, depending on the connector you want to configure.

For example, to enable TRACE HTTP requests to Martini Server Runtime, add a property called server.tomcat.http.allowTrace and set it to true.

1
server.tomcat.http.allowTrace=true

Below are properties that can be tuned to optimize Martini Server Runtime's Tomcat server:

Property Name Description
acceptCount Maximum queue length for incoming connection requests when all request processing threads are in use. The default value is 100.
acceptorThreadCount Number of threads for accepting connections. Adjust for multi-processor machines or high non-keep alive connections. The default value is 1.
maxConnections Maximum number of connections the server will accept and process simultaneously.
maxThreads Maximum number of request processing threads. Default is 200.
minSpareThreads Minimum number of threads always kept running. Default is 10.
port TCP port number for this connector. If the special value of 0 is used, then Tomcat will select a free port at random to use for this connector.

For example, to configure Martini's Tomcat with HTTP running on port 80, allowing only 10 threads, and HTTPS running on port 443 with a specific keystore file and password, you would use:

1
2
3
4
5
6
server.http.port=80
server.https.port=443
server.tomcat.http.maxThreads=10
server.tomcat.https.keystoreFile=/home/martini/keystore
server.tomcat.https.keystorePass=12345ABCDE
server.tomcat.https.acceptorThreadCount=5