Prevent Tomcat from scanning on startup
In order to improve our startup times, we need to prevent tomcat from scanning for TLDs on startup as this takes a long time, especially in cloud environments
PR: https://github.com/dotCMS/tomcat/pull/26
I tested this issue as follows:
I had dotCMS start up every time using an empty database and a full starter every time I would wipe out the old asset as well as remove any existing logs from tomcat
These are extracts from catalina.out after every start
With scan jars feature ON:
11-Aug-2022 15:47:18.879 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [153674] milliseconds
11-Aug-2022 15:54:14.331 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [155745] milliseconds
11-Aug-2022 16:00:15.835 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [148936] milliseconds
11-Aug-2022 16:05:36.187 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [151685] milliseconds
11-Aug-2022 16:10:59.280 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [157752] milliseconds
Average: 153558.4
With scan jars feature OFF:
11-Aug-2022 16:17:37.493 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [136374] milliseconds
11-Aug-2022 16:22:04.947 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [146059] milliseconds
11-Aug-2022 16:26:29.511 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [142955] milliseconds
11-Aug-2022 16:30:49.949 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [138162] milliseconds
11-Aug-2022 16:35:59.910 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [139245] milliseconds
Average: 140559
There's a slight improvement in the startup time.
Also, I can confirm that the following message appears when the jars scanning is not disabled
11-Aug-2022 15:45:06.267 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
After these changes, the message is gone. So I'm passing it.
Pass QA with Note - Tested on 22.09_da9b379b_SNAPSHOT // Docker // FF
I can confirm that the above message does not appear on the log of the local server, however I can not confirm it appears if the configuration is change due to the fact that I can't control the functionality.
docker-dotcms-1| 19-Aug-2022 20:52:19.479 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [158428] milliseconds