startup time, slow "Executable WAR" with JDWP?

30 views
Skip to first unread message

Pascal Rigaux

unread,
Nov 20, 2021, 6:38:59 AM11/20/21
to cas-...@apereo.org

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"

Pascal Rigaux

unread,
Nov 20, 2021, 8:40:00 AM11/20/21
to cas-...@apereo.org

Hi again :

I just found out that my tests were running with TieredCompilation...

Here are some more test results below.
Conclusions:
=> TieredCompilation is a good CPU win, but often a bad elapsed choice
=> executable war & tomcat >50% elapsed overhead (?!)
=> jdwp is mostly harmless (except for Excutable WAR + JDWP + TieredCompilation)

NB :
- tested on a VM with 8 vCPUs
- tested with the following TieredCompilation options: -XX:+TieredCompilation -XX:TieredStopAtLevel=1
 

  par défaut TieredCompilation TieredCompilation overhead
  elapsed CPU elapsed CPU elapsed CPU
WarLauncher on exploded WAR 18 s
68 s 18 s 25 s 0 % -63 %
WarLauncher on exploded WAR + jdwp 18 s
75 s 18 s 26 s 0 % -65 %
java -jar cas.war 28 s 90 s 37 s 47 s 32 % -48 %
java -jar cas.war + jdwp
31 s 106 s 96 s 109 s 210 % 3 %
tomcat (exploded ou war) 28 s 91 s 33 s 43 s 18 % -53 %
tomcat + jdwp 33 s 109 s 36 s 46 s 9 % -58 %
             
overheads:            
java -jar cas.war 56 % 32 % 106 % 88 %    
tomcat 56 % 34 % 83 % 72 %    
jdwp (for WarLauncher on exploded WAR) 0 %
10 % 0 % 4 %    
jdwp (for java -jar cas.war)
11 % 18 % 159 % 132 %    
jdwp (for tomcat) 18 % 20 % 9 % 7 %    




Pascal Rigaux <Pascal...@univ-paris1.fr> a écrit :

Reply all
Reply to author
Forward
0 new messages