Tomcat 8 Slow Start Using DeployWAR

I went from Tomcat 7.0.54 to 8.0.15, upgraded openSSL to 1.0.1k and became the latest 1.1.32 with APR 1.5.1.

However, Tomcat now starts about 2-3 times slower than before. Most notably, deploying WAR files takes much longer.

Tomcat 7

Jan 20, 2015 3:39:36 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive <PATH>\file.war has finished in 433 ms 

Tomcat 8

 Jan 21, 2015 2:27:01 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive <PATH>\file.war has finished in 4,310 ms 

This happens with all WAR files, everything went from milliseconds to 5 seconds.

I uninstalled JasperListener from server.xml because it seems to have been removed.

 unpackWARs="false" autoDeploy="true" 

unpackWars does not matter if set to true (at least not specified). I thought this might be an annotation scan problem fixed in 8.0.17, but no luck.

I noticed that jarsToSkip in catalina.properties has changed from

 tomcat.util.scan.DefaultJarScanner.jarsToSkip to tomcat.util.scan.StandardJarScanFilter.jarsToSkip 

and that org.apache.catalina.startup.TldConfig.jarsToSkip is deleted and moved into the .xml context

 <JarScanner> <JarScanFilter tldSkip="websocket-api.jar,tomcat-websocket.jar"/> </JarScanner> 

However, none of this seems to bring me back to tomcat 7's performance. One action that did this was to remove the banners from the websocket. However, we need them. This leads me to the conclusion that they are still scanned, although they should be skipped.

Am I missing something? Does context.xml not do the same as catalina.properties jarsToSkip?

+5
source share
4 answers

The solution for slow startup as a whole for me was to put in conf / context.xml:

 <Context> <JarScanner> <JarScanFilter defaultPluggabilityScan="false" /> </JarScanner> </Context> 

Source: https://groups.google.com/a/apereo.org/forum/#!topic/sakai-dev/cjtYGxd6hG0

+5
source

I have similar problems.

One of the options that improved startup time was to add:

 metadata-complete="true" 

in web.xml (webapp element), as recommended at http://wiki.apache.org/tomcat/HowTo/FasterStartUp . This assumes that your web.xml is all that is needed to download your web application.

This did not completely fix the problem for me, but an improvement in startup speed was significant.

+1
source

Are you sure unpackWARs = "true" does not affect you?

The discussion continues on this topic in bugzilla:

https://issues.apache.org/bugzilla/show_bug.cgi?id=57251

There it was found that the behavior of Tomcat 8 when unpackWARs = "false" will be noticeably slower due to the simplification of the implementation executed in the code.

0
source

you can try parallelism to run by changing the attribute of the host element <Host ... startStopThreads="0"/> in conf/server.xml

0
source

Source: https://habr.com/ru/post/1211913/


All Articles