Faster Start Up

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Faster Start Up

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

I was looking at the "faster start up" wiki page[1] today and reading
about ow to disable things that are not necessary in order to improve
application startup times.

While there seems to be lots of suggestions for what configuration
options to look at, it's not actually clear how to use them.

My application uses no annotations, no SCIs, no nothing, so I want to
disable everything. It's not clear to me how to actually DO that.

There /is/ a specific example for how to disable the WebSocket:

* Add containerSciFilter="WsSci" to your <Context>

There are also specific examples for disabling web.xml merging using
metadata-complete="true" and <absolute-ordering /> in web.xml.

But what about disabling all JAR scanning? Do the
metadata-complete="true" and <absolute-ordering /> already accomplish
that? Or do you need more?

Reading the documentation for <JarScanner>/<JarScanFilter> it looks
like maybe this would work:


<JarScanner>
    <JarScanFilter pluggabilityScan="" tldScan="" />
</JarScanner>

Or maybe:

<JarScanner>
    <JarScanFilter pluggabilitySkip="*" tldSkip="*" />
</JarScanner>

Or maybe a combination of the two?

If I specify one of the above, will the JAR scan still occur (meaning,
enumerate the list of JAR files and run through them) but no JAR files
will actually be opened? Or will the scanning process be skipped
entirely if the JarScanner sees that its configuration implies it will
never do any work?

Thanks,
- -chris

[1] https://cwiki.apache.org/confluence/display/TOMCAT/HowTo+FasterStart
Up
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8PDz4ACgkQHPApP6U8
pFiuDg/9HX6pgO0apfeNzvh0DO4pXNa64nH3g4l/se2SgmH316W2j9EuT6+rE4Kq
nNEdDs06F/2P3kqSGfU6ZiyejIO/tVqjd79VMkfWtvdg1jKuMH3ZiVbb88SCSaKD
QDdEMOdtsTh0YhctykQot/+xDHoC87MHuCwTAJag8BsAYUVr0b91RiuTv7wcuG77
mFOyBm1a2EBRo7nH9k961EcnkQyrLf9sdejVsLThUnTdI7UlP1onXql0xMIUyIc4
ilfHpwTilf6ZbKIHEQOJ14YSuwLdSI3Riwjwz3+lqE8FTCUFSKXR8Pg2s+WjztE4
lE/MOzc94cBOhjPTNhjOZLpAQkfXQAIXKA9VIO37sbvfAhoFzC6RyHFYKnAJqsNf
J4+at3lgQvuyTXTJp82jQFHWoSR55KuIo/g5wMzK3FxsYziYhLDnGZ8Urh+A51L5
Rsaf0zvDUUvqwbWxqxZ/mHfXGnXHGebZPcExK0pVwZ1wj+Fy7kjULB1TNUrlHgRB
Fzfnb/b5oROCRyk7EMFMo7m+r5Vvv41+3bd9rGX2iWHSkiFB0tQVlheegwAEKQFT
o0GmDHQajBi6onJ/GMyKpU8KrsAuq//L7F3JiLXEC/TKJETRIrHuab3ALBQXbi9x
IUqie1AwxjXG9I94GRxw/m+y8let5693aohccBlOp3w+WDWzSaQ=
=kNk1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Faster Start Up

Christopher Schultz-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

On 7/15/20 10:14, Christopher Schultz wrote:
> Reading the documentation for <JarScanner>/<JarScanFilter> it
> looks like maybe this would work:
>
> <JarScanner> <JarScanFilter pluggabilityScan="" tldScan="" />
> </JarScanner>

With the above configuration, I still see this INFO log in my log file:

INFO: 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.

> Or maybe:
>
> <JarScanner> <JarScanFilter pluggabilitySkip="*" tldSkip="*" />
> </JarScanner>

Looks like this gets the job done.

I'm curious: why does tldScan="" not work?

> If I specify one of the above, will the JAR scan still occur
> (meaning, enumerate the list of JAR files and run through them) but
> no JAR files will actually be opened? Or will the scanning process
> be skipped entirely if the JarScanner sees that its configuration
> implies it will never do any work?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8PNBAACgkQHPApP6U8
pFhkkBAAl1MLW79GuyPRC8QP/ZeWwFJcpDL52JgS7NR/xulENkybpFtqCjzfXdzv
w8jMKDN6AkcFzVo6oNnGkuMn4hUKSVHE8y44kMNW49YNGn7xSnqXt8iXDOUVkrqv
kP1S82Yjc3UZxfQ8CZrGU/VV8qCwGgbRwbNLJp6VdS0tedJCku9MI1KpVu1tKCi0
uSV+39j6DRAnWgdnaCaxRPBROm0R7d5TB2fR+C/uzfxXnxaL+kihGp9hDlenbeFS
JhQigxP2+U6o9J2GtDKSk2v2+yre01ZWDwPKG0SIU0hvZfIxo2mxjkt2Pze9P7yT
UC8lNaZ/asL1PQW3+6rWep7Pp4XEYGz929HQdOZFhIoGpzPvVwDVFiJ22bib41SB
+/oiRWoly2xwwBHN+U30SS2TMsqvBxvXZKb07riK7BeOB/Ep42Wh/LDFw5W0ZKRs
jDW3to0JaqdcLkBftRKmdJT1zwn/3KcIVWcLioyx/lr+kQpykEfMCeeZ5BWonEWp
OP86c6ofbwv32h5qkFT4DPRd8tNDFDI8S9UpNnGcmnTMDbJEkA5sIsdgx8AvOGwp
5CAr1ME6TeAmmx8yZsCHv2wSkNsuKEAggq5MOW7V3VdS37ChV8TBW86Kl3n2OXn/
T1s+P1RGg1T0nBUf7bA7zecUmD2urH/HYg/ncoysshA5XjjPQ7g=
=hvr2
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Faster Start Up

Luis Rodríguez Fernández
Hello Chris,

Yes, I do agree that <JarScanner>/<JarScanFilter> docs do not look very
clear. We after different test ended up with configurations like this one
(${CATALINA_BASE}/conf/context.xml)

<JarScanner scanClassPath="false">
  <JarScanFilter tldSkip="*.*"/>
</JarScanner>

or this other one (${CATALINA_BASE}/conf/catalina.properties)

tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.*

for disabling completely the jar scanning.

Cheers,

Luis

ps: finally we decided to disable the jar scanning just for the jars that
we were adding ourselves in our custom tomcat image (keycloak for SSO,
jolokia for monitoring and some utilities). Our colleague Thomas added
below shell kung-fu to our Dockerfile

RUN jars_to_skip_in_tld_search=$(find ${CATALINA_BASE}/lib/* -printf "%f,")
\
 && line_number_of_beginning_of_skip_list=$(sed -n
'/tomcat.util.scan.StandardJarScanFilter.jarsToSkip=\\/='
${CATALINA_BASE}/conf/catalina.properties) \
 && comment_to_insert="# Note: The first line of the list (and this
comment) was inserted while\n# building the image to skip TLD scanning of
our own jars." \
 && sed -i
"${line_number_of_beginning_of_skip_list}a\\${jars_to_skip_in_tld_search}\\\\"
${CATALINA_BASE}/conf/catalina.properties \
 && sed -i
"${line_number_of_beginning_of_skip_list}i\\${comment_to_insert}"
${CATALINA_BASE}/conf/catalina.properties \
 && echo "Will skip jars: ${jars_to_skip_in_tld_search}"

pps: BTW: thanks Thomas, it works!











El mié., 15 jul. 2020 a las 18:51, Christopher Schultz (<
[hidden email]>) escribió:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> All,
>
> On 7/15/20 10:14, Christopher Schultz wrote:
> > Reading the documentation for <JarScanner>/<JarScanFilter> it
> > looks like maybe this would work:
> >
> > <JarScanner> <JarScanFilter pluggabilityScan="" tldScan="" />
> > </JarScanner>
>
> With the above configuration, I still see this INFO log in my log file:
>
> INFO: 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.
>
> > Or maybe:
> >
> > <JarScanner> <JarScanFilter pluggabilitySkip="*" tldSkip="*" />
> > </JarScanner>
>
> Looks like this gets the job done.
>
> I'm curious: why does tldScan="" not work?
>
> > If I specify one of the above, will the JAR scan still occur
> > (meaning, enumerate the list of JAR files and run through them) but
> > no JAR files will actually be opened? Or will the scanning process
> > be skipped entirely if the JarScanner sees that its configuration
> > implies it will never do any work?
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl8PNBAACgkQHPApP6U8
> pFhkkBAAl1MLW79GuyPRC8QP/ZeWwFJcpDL52JgS7NR/xulENkybpFtqCjzfXdzv
> w8jMKDN6AkcFzVo6oNnGkuMn4hUKSVHE8y44kMNW49YNGn7xSnqXt8iXDOUVkrqv
> kP1S82Yjc3UZxfQ8CZrGU/VV8qCwGgbRwbNLJp6VdS0tedJCku9MI1KpVu1tKCi0
> uSV+39j6DRAnWgdnaCaxRPBROm0R7d5TB2fR+C/uzfxXnxaL+kihGp9hDlenbeFS
> JhQigxP2+U6o9J2GtDKSk2v2+yre01ZWDwPKG0SIU0hvZfIxo2mxjkt2Pze9P7yT
> UC8lNaZ/asL1PQW3+6rWep7Pp4XEYGz929HQdOZFhIoGpzPvVwDVFiJ22bib41SB
> +/oiRWoly2xwwBHN+U30SS2TMsqvBxvXZKb07riK7BeOB/Ep42Wh/LDFw5W0ZKRs
> jDW3to0JaqdcLkBftRKmdJT1zwn/3KcIVWcLioyx/lr+kQpykEfMCeeZ5BWonEWp
> OP86c6ofbwv32h5qkFT4DPRd8tNDFDI8S9UpNnGcmnTMDbJEkA5sIsdgx8AvOGwp
> 5CAr1ME6TeAmmx8yZsCHv2wSkNsuKEAggq5MOW7V3VdS37ChV8TBW86Kl3n2OXn/
> T1s+P1RGg1T0nBUf7bA7zecUmD2urH/HYg/ncoysshA5XjjPQ7g=
> =hvr2
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

--

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett