Lucee on GraalVM

I successfully ran Lucee on a GraalVM Java without no extra effort. Using the Express installation it is booting gracefully and my feel it’s faster then normal java but didn’t benchmark/measured yet.

GraalVM is a universal virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Groovy, Kotlin, Clojure, and LLVM-based languages such as C and C++.

GraalVM removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js or Oracle Database.

More info:
GraalVM (Web)

https://www.graalvm.org

server:~$ java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-20190711120915.buildslave.jdk8u-src-tar--b08)
OpenJDK 64-Bit **GraalVM CE** 19.2.0 (build 25.222-b08-jvmci-19.2-b02, mixed mode)
server:~$ which java
/home/omar/graalvm-ce-19.2.0/bin/java
server:~$ ./startup.sh
Using CATALINA_BASE:   /home/omar
Using CATALINA_HOME:   /home/omar
Using CATALINA_TMPDIR: /home/omar/temp
**Using JRE_HOME:        /home/omar/graalvm-ce-19.2.0**
Using CLASSPATH:       /home/omar/bin/bootstrap.jar:/home/omar/bin/tomcat-juli.jar
10-Sep-2019 16:44:18.443 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/9.0.11
10-Sep-2019 16:44:18.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Aug 11 2018 19:47:23 UTC
10-Sep-2019 16:44:18.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.11.0
10-Sep-2019 16:44:18.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
10-Sep-2019 16:44:18.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.15.0-55-generic
10-Sep-2019 16:44:18.445 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
10-Sep-2019 16:44:18.445 INFO [main] **org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /home/omar/graalvm-ce-19.2.0/jre**
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_222-20190711120915.buildslave.jdk8u-src-tar--b08 10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /home/omar
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /home/omar
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/home/omar/conf/logging.properties
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
10-Sep-2019 16:44:18.446 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/home/omar
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/home/omar
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/home/omar/temp
10-Sep-2019 16:44:18.447 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
10-Sep-2019 16:44:18.532 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
10-Sep-2019 16:44:18.544 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
10-Sep-2019 16:44:18.552 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
10-Sep-2019 16:44:18.553 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
10-Sep-2019 16:44:18.553 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 482 ms
10-Sep-2019 16:44:18.575 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
10-Sep-2019 16:44:18.576 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.11
10-Sep-2019 16:44:18.585 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/home/omar/webapps/ROOT]
10-Sep-2019 16:44:18.988 INFO [main] 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.
10-Sep-2019 16:44:20.184 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/home/omar/webapps/ROOT] has finished in [1,598] ms
10-Sep-2019 16:44:20.187 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8888"]
10-Sep-2019 16:44:20.214 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
10-Sep-2019 16:44:20.238 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1684 ms
2 Likes

I’m curious to know if anyone ever did something more than this. It would be nice to know what GraalVM could bring in combination with Lucee in terms of benchmarks.

I think the real benefit of GraalVM is the fact that you can compile to native, which results in Java applications to have super fast startup times and a lot less memory consumption. This would be really interesting if you want to make your CFML code available for the cloud.

However compiling to native will not work with Lucee in combination with either Jetty or Tomcat, is what I understand now.

Of course there is an alternative: Fuseless for AWS Lambda. But that is more a FAAS solution.

Cheers.