Although closed in
XWIKI-16236 (see also XWIKI-15756) I re-examined the cache-size issue and have found that a much lower value is sufficient; even lower than the original "20480" value which is 100% larger than the default tomcat value. I was able to get no warnings (as in XWIKI-16236 ) going all the way down to 10% larger than the default value at "11264".
However in all cases, on shutdown there are warnings, and even worse, there were stacktraces prior to my clearing the cache via Admin.FlushCache app in Admin Tools. I wonder whether some kind of cache corruption resulted in my need for much larger values, as the original "20,480" value worked fine, either after cache clearing, or after performing the optimization below:
I applied some further optimizations to tomcat8 per https://tcollignon.github.io/2016/02/09/Accelerate-tomcat-78-start-up.html and https://wiki.apache.org/tomcat/HowTo/FasterStartUp. Specifically, disabling JSP and WebSocket support, and removing the default home page at "webapps/ROOT". So it is unclear whether the cache-clearing or the removal of unneeded features in tomcat ended up not causing the cache warning messages on startup seen in
XWIKI-16236. The optimizations are already part of
but were missing in the debian tomcat8 distribution.
With above optimization the following lines of output no longer appear in catalina.out and the application exhibits overall faster startup.
15-Mar-2019 20:26:13.733 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat8/webapps/ROOT]
15-Mar-2019 20:26:14.730 INFO [localhost-startStop-1] 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.
15-Mar-2019 20:26:14.744 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat8/webapps/ROOT] has finished in [1,011] ms
The proposed update is to the same file of my recent PR associated with
XWIKI-16236. also updated the documentation to be consistent as per vmassol's comments on github: https://github.com/xwiki/xwiki-platform/pull/1083
The following is the proposed xwiki-tomcat8.xml:
Context configuration file for the XWiki Web App
This file is used only for Tomcat8 deployment of XWiki via debian packages.
It is equivalent to, and needs to be kept up to date with traditional
Prevent JAR scanning and disable WebSocket and JSP support.
This is done to optimize Tomcat startup time, per
(see: "Disable scanning the web application",
"Disable scanning web-fragment jar",
"Disable both WebSocket and JSP support (only tomcat 8)",
"Excludes jars for scanning")
<Context path="/xwiki" docBase="/usr/lib/xwiki"
<!-- Make symlinks work in Tomcat, and fix problem described in
XWIKI-16236 & XWIKI-15756 causing catalina.out warnings on "evicting
expired cache entries", which is solved by increasing the cache
<Resources allowLinking="true" cachingAllowed="true"
cacheMaxSize="12800" cacheObjectMaxSize="640" />
Note the above uses a cache size of 125% of the default. Although 110% works (11264), it is not a "nice size" for a cache (and results in noninteger cacheObjectMaxSize suggested by tomcat docs), so I went with "12800"