OpenLiberty / ci.docker

Eclipse Public License 1.0
42 stars 59 forks source link

slow server startup in configure.sh when building app image with Open Liberty and Java 17 #539

Open tam512 opened 2 months ago

tam512 commented 2 months ago

Build daytrader10 container image on a Ubuntu 2204 Fyre VM. It takes about 5 minutes to complete the RUN time configure.sh step. It stays at Starting server defaultServer for a long time

FROM icr.io/appcafe/open-liberty:full-java17-openj9-ubi
....
RUN time configure.sh

Features in server.xml

    <featureManager>
      <feature>enterpriseBeans-4.0</feature>
      <feature>servlet-6.0</feature>
      <feature>faces-4.0</feature>
      <feature>pages-3.1</feature>
      <feature>persistence-3.1</feature>
      <feature>mdb-4.0</feature>
      <feature>cdi-4.0</feature>
      <feature>websocket-2.1</feature>
      <feature>concurrent-3.0</feature>
      <feature>connectors-2.1</feature>
      <feature>jsonp-2.1</feature>
      <feature>jsonb-3.0</feature>
      <feature>beanValidation-3.0</feature>
      <feature>restfulWS-3.1</feature>
      <feature>ssl-1.0</feature>
      <feature>messaging-3.1</feature>
      <feature>mpHealth-4.0</feature>
   </featureManager>

Output time at the end of configure.sh

STEP 7/7: RUN time configure.sh
+ main
+ WLP_INSTALL_DIR=/opt/ol/wlp
............
...............................
openjdk version "17.0.10" 2024-01-16
IBM Semeru Runtime Open Edition 17.0.10.0 (build 17.0.10+7)
Eclipse OpenJ9 VM 17.0.10.0 (build openj9-0.43.0, JRE 17 Linux amd64-64-Bit Compressed References 20240116_670 (JIT enabled, AOT enabled)
OpenJ9   - 2c3d78b48
OMR      - ea8124dbc
JCL      - 2aad089841f based on jdk-17.0.10+7)
.........................
....................................
+ echo 'SCC layer is 80% full.'
SCC layer is 80% full.

real    5m2.882s
user    1m54.328s
sys 0m9.691s

It seems to build faster in travis. Below is the time from travis build log

#10 [6/6] RUN configure.sh
#10 0.222 + main
#10 0.222 + WLP_INSTALL_DIR=/opt/ol/wlp
...........
#10 0.914 Starting server defaultServer.
#10 32.69 Server defaultServer started with process ID 62.
...........
#10 56.94 SCC layer is 81% full.
#10 DONE 57.1s
tam512 commented 2 months ago

I only see this problem when building with icr.io/appcafe/open-liberty:full-java17-openj9-ubi. It is much faster when building with icr.io/appcafe/open-liberty:full-java11-openj9-ubi or icr.io/appcafe/open-liberty:full-java21-openj9-ubi-minimal

real 0m36.723s user 1m37.164s sys 0m8.095s COMMIT dt10:ol-full-java11 --> d1b55543bc6

- Here is time when building with _icr.io/appcafe/open-liberty:full-java21-openj9-ubi-minimal_

STEP 7/7: RUN time configure.sh ............ openjdk version "21.0.2" 2024-01-16 LTS IBM Semeru Runtime Open Edition 21.0.2.0 (build 21.0.2+13-LTS) Eclipse OpenJ9 VM 21.0.2.0 (build openj9-0.43.0, JRE 21 Linux amd64-64-Bit Compressed References 20240116_94 (JIT enabled, AOT enabled) OpenJ9 - 2c3d78b48 OMR - ea8124dbc JCL - 78c4500a434 based on jdk-21.0.2+13) ....................... SCC layer is 81% full.

real 0m41.052s user 1m44.250s sys 0m10.282s