Hi,
I was modifying templates and found a way to keep using embedded tomcat while being able to easily modify the templates (since then I tried using templates outside of classpath) :
gradle unzipWAR && java -cp "build/app:build/app/WEB-INF/classes:build/app/WEB-INF/lib/*" org.springframework.boot.loader.WarLauncher
I wondered why it was much faster to start... So I tested various possibilities.
(NB: I often enable jdwp by default just in case it can be useful to see things with a debugger)
Below are some quite astonishing results...
|
|
elapsed |
CPU |
|
WarLauncher on exploded WAR |
18 s |
25 s |
|
WarLauncher on exploded WAR + jdwp |
18 s |
26 s |
|
java -jar cas.war |
37 s |
47 s |
|
java -jar cas.war + jdwp |
96 s |
109 s |
|
tomcat (exploded ou war) |
33 s |
43 s |
|
tomcat + jdwp |
36 s |
46 s |
|
|
|
|
|
overheads: |
|
|
|
java -jar cas.war |
106 % |
88 % |
|
tomcat |
83 % |
72 % |
|
jdwp (for WarLauncher on exploded WAR) |
0 % |
4 % |
|
jdwp (for java -jar cas.war) |
159 % |
132 % |
|
jdwp (for tomcat) |
9 % |
7 % |
tested with
- AdoptOpenJDK 15.0.2+7 (also tested debian openjdk 11.0.6+10-1~bpo9+1 with only minor changes)
- CAS 6.4.2 with various modules
- tomcat 9.0.54
- somewhat old OS : debian 9 on VMware
details:
- WarLauncher on exploded WAR = java -cp "build/app:build/app/WEB-INF/classes:build/app/WEB-INF/lib/*" org.springframework.boot.loader.WarLauncher
- CPU = "TIME" column of ps (ie "accumulated cpu time, user + system")
- elapsed = time it takes to reach CAS "Ready to process requests"