Methods to address a slow Tomcat/Railo/Lucee startup

Methods to address a slow Tomcat/Railo/Lucee startup

Recently my technicians and I encountered an issue with a hosting customer who had an interesting situation between two VPS Accounts that he owns. The first VPS had a relatively quick startup time (under a minute), and the second VPS had an extremely slow startup time (above 5 minutes). Both VM’s were relatively similar, and both served a great number of sites. The following are the two options that corrected the issue:

OPTION 1

Set property in TOMCAT_HOME/conf/catalina.properties:

org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar

This will turn off jar scanning during the Tomcat startup.

OPTION 2

Configure the number of concurrent threads for Tomcat to use to create new contexts by adding the “startStopThreads” attribute to the <engine> tag in the Tomcat server.xml file. The number of threads should not be higher the number of CPU cores available to your server or the threads might overlap and you probably won’t get the speed boost you were hoping for.

Once these options were implemented, both servers started up in just a few seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *

15 − 9 =