Visit Azul.com Support

Registering a New Compiler Engine in Cloud Native Compiler

Table of Contents
Need help?
Schedule a consultation with an Azul performance expert.
Contact Us

Since different versions of Azul Zulu Prime JVMs may require different compiled code, Optimizer Hub’s Cloud Native Compiler must be able to produce different versions of compiled code simultaneously. You do not need to create a separate Optimizer Hub instance for each application or different Java version.

Cloud Native Compiler does not have its own compiler - it is just server-side infrastructure for running the JIT compiler that ships inside of Azul Zulu Prime Builds of OpenJDK. This compiler is uploaded to Cloud Native Compiler from the JVM in the form of a Compiler Engine.

Each version of Azul Zulu Prime JVM contains a signed Compiler Engine distributable. The JVM auto-uploads any missing compiler engine on startup. Compiler Engines are signed to prevent malicious versions of Compiler Engines from being installed.

If an Azul Zulu Prime JVM connects to a Cloud Native Compiler service that does not have the corresponding Compiler Engine installed, the JVM automatically switches to performing the optimizations on the client VM.

Note
Cloud Native Compiler does not keep any persistent record of compiler engines. If a JVM requests compilations from Cloud Native Compiler that does not have the corresponding compiler engine, the JVM switches to local JIT compilation and starts auto-uploading the compiler engine for future use.

Auto-Uploading Compiler Engines

For JVMs connecting to Cloud Native Compiler in the same Kubernetes cluster, or connecting to Cloud Native Compiler that is fronted by an external load-balancer, auto-uploading works with no additional configuration.

For JVMs connecting to Cloud Native Compiler in an external Kubernetes cluster with no external load-balancer, pass the IP address and port of Cloud Native Compiler’s gateway service in the --XX:CNCEngineUploadAddress flag. See Connecting a JVM to a Cloud Native Compiler for how to get the IP address of the gateway service. Make sure you use the port that is mapped to 8080 in the gateway service.

Inspecting the Installed Compiler Engines

Each Compiler Engine has a Compiler Engine ID. You can view all of the Compiler Engines that are installed on a Cloud Native Compiler by calling the /compiler-engines REST API on the gateway service’s 8080 port when calling from inside the cluster or the external port that is mapped to 8080 when calling from outside the cluster.