I am in the process of moving my Lucee apps over to Docker and it sometimes takes up to 4 minutes to spin up a container and start serving pages with Lucee 6.2.1.122.
I’m using the official Lucee docker build: lucee/lucee:6.2.1.122-nginx
One thing I noticed is that this log entry takes a while:
03-May-2025 05:44:18.966 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.
I’m only getting one of these messages now, but I was getting a bunch of them, and they each take about 20 seconds.
Also, I know I can run a “light” build and then add only the extensions I need, which seems like a good way to go. What’s the best way for me to do that? Do I need to do anything special to my config file, or is Lucee smart enough to download what it needs when it imports my config?
This may or may not apply the same anymore (I haven’t checked newer versions of Tomcat/Lucee), but in the past, you could completely turn off the class path scanning or specify what you wanted to be scanned. I had a scenario where Railo/Lucee would take a minute+ to start. This change dropped it down to seconds.
Option 1:
In /conf/context.xml, add the following line: <JarScanner scanClassPath="false" />
Option 2:
In /conf/catalina.properties, find tomcat.util.scan.StandardJarScanFilter.jarsToSkip and set to tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar.
Just to reiterate, I don’t know offhand if those locations still apply as I haven’t set up Lucee in a while, but they used to in older versions of Tomcat. Your mileage may vary, as I’m also not aware of any caveats with this change in Lucee apps, though I personally never had any issues.
4 minutes is a /really/ long time… The longest I’ve seen 6.2.1 take to load is like 10 seconds – and that was when I was pre-warming and downloading all the extensions.
How much memory/CPU are you dedicating to the container (or are available on the host)? I’ve found 1CPU + 1GB ram to be the smallest I would load – but I’ve got away with 512MB RAM in a pinch.
Are you building your own Dockerfile that has the FROM lucee/lucee:6.2.1.122-nginx ? Or are you just using the stock one and copying over your files? If you are building your own script, I would highly recommend doing the prewarm command in your dockerfile so that it grabs the extensions and does all the other pre-check stuff.
Have you thought about trying one of the non-nginx containers? That’s most just to see if there is a speed difference.