Visit Azul.com Support

Using the Cloud Native Compiler

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

You configure an Azul Zulu Prime Build of OpenJDK (Azul Zulu Prime JVM) to request compilations from Cloud Native Compiler by specifying the IP address of the service along with other command-line options. If the Cloud Native Compiler cannot respond to the compilation requests in time, the Azul Zulu Prime JVM switches to local JIT compilation until the service recovers.

Cloud Native Compiler JVM Options

Note
The minimum JVM options to request compilations from Cloud Native Compiler are -XX:OptHubHost={host:port} and -XX:+CNCEnableRemoteCompiler.
Command Line Option Description Default

-XX:OptHubHost={host:port}

Address where Optimizer Hub is listening. The default is localhost:50051. See Configuring Optimizer Hub Host and Port for instructions on determining the correct host and port.

-XX:[+/-]CNCEnableRemoteCompiler

Allows usage of the remote compiler when Cloud Native Compiler has established a connection.

false

-XX:CNCEngineUploadAddress={host:port}

Address to upload the compiler engine. Only needed when your Optimizer Hub has non-standard ports. See Specifying a Custom Compiler Engine Upload Port.

-XX:[+/-]CNCAbortOnBadChannel

With this flag, the JVM crashes if it loses connection with a Cloud Native Compiler.

false

-XX:[+/-]OptHubUseSSL

Instructs the Azul Zulu Prime JVM to communicate directly with Optimizer Hub without using SSL. Use this option if you installed Optimizer Hub without SSL.

true

-XX:OptHubSSLRootsPath={path to cert.pem}

Instructs the Azul Zulu Prime JVM to use and trust a specified SSL certificate on the filesystem.

-Xlog:[+/-]concomp

Display messages describing communication with Optimizer Hub.

false

Fallback to Local JIT Compilation

When you connect an Azul Zulu Prime JVM to a Cloud Native Compiler, the JVM attempts to fetch all JIT compilations from the service. If the Cloud Native Compiler cannot meet the JVM’s requests in time, the JVM automatically falls back to performing optimizations on the client. Factors that can cause a Cloud Native Compiler to not meet optimization demand include:

  • The service does not have the corresponding Compiler Engine installed. To force an Azul Zulu Prime JVM to fail when requesting optimizations from a Cloud Native Compiler that doesn’t have the corresponding Compiler Engine installed, use the -XX:+CNCAbortOnBadChannel flag.

  • The service is down or cannot be reached.

  • The service does not have enough capacity to meet the optimization requests. If you have autoscaling enabled, this is often a temporary problem as new resources come online. See Sizing and Scaling your Optimizer Hub Installation for more info.

When an Azul Zulu Prime JVM switches to local JIT compilation, it keeps checking whether Cloud Native Compiler is ready to perform optimizations. Once Cloud Native Compilation is back online and healthy, the Azul Platform Prime JVM switches back to requesting optimizations from the service.

The following output in the JVM concomp log show when fallback to local JIT compilation is enabled and disabled:

 
[110,991s][info ][concomp] [LocalFallback] local compilation queue disabled [111,018s][info ][concomp] [LocalFallback] local compilation queue enabled

Logging and SSL

To view compiler info and ensure that the JVM is correctly connecting to Optimizer Hub, use the -Xlog:concomp flag.

By default the Azul Zulu Prime JDK connects to Optimizer Hub using SSL. If you did not enable SSL during Optimizer Hub deployment, you must use the -XX:-OptHubUseSSL flag to instruct the Azul Zulu Prime JDK to connect without SSL.

If you attempt to connect to Optimizer Hub, running without SSL, and do not specify the -XX:-OptHubUseSSL flag, you get the following error (visible with the -Xlog:concomp flag):

 
E1011 13:16:23.198074100 29 ssl_transport_security.cc:1446] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number.