Visit Azul.com Support

Using the CNC Compiler Service

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 (CNC) 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

Flag Description

-XX:CNCHost=host:port

Address where CNC is listening. The default is localhost:50051. See Connecting a JVM to Cloud Native Compiler for instructions on determining the correct host and port.

-XX:[+/-]CNCEnableRemoteCompiler

Allows usage of the remote compiler when CNC has established a connection. Default value is false.

Replaces the deprecated option CNCForceLocalCompiler.

-XX:CNCEngineUploadAddress=host:port

Address to upload the compiler engine. Only needed when using auto-upload and non-standard ports of the service.

-XX:[+/-]CNCAbortOnBadChannel

With this flag, VM will crash if it loses connection with a CNC server. Default value is false.

-XX:[+/-]CNCInsecure

Instructs the Azul Zulu Prime JVM to communicate directly with CNC without using SSL. Use this option if you installed CNC without SSL. Default value is false.

-XX:CNCSSLRootsPath=<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 CNC server. Default value is false.

Fallback to Local JIT Compilation

When you connect an Azul Zulu Prime JVM to a Cloud Native Compiler (CNC), 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 service 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.

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 CNC, use the -Xlog:concomp flag.

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

If you attempt to connect to CNC, running without SSL, and do not specify the -XX:+CNCInsecure 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.