Allows usage of the remote compiler when Cloud Native Compiler has established a connection. Requires OptHubHost
.
Using Cloud Native Compiler
You configure an Azul Zing Build of OpenJDK (Zing) 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 Zing 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=<dns> |
DNS name of the Optimizer Hub service where Optimizer Hub is listening, as specified . The default is |
null |
||
-XX:[+/-]CNCEnableRemoteCompiler |
|
|||
-XX:CNCEngineUploadAddress={host:port} |
Address to upload the compiler engine. Only needed when your Optimizer Hub has non-standard ports.
|
|||
-XX:[+/-]OptHubUseSSL |
Instructs the Zing JVM to communicate directly with Optimizer Hub without using SSL. Use this option if you installed Optimizer Hub without SSL. |
|
||
-XX:OptHubSSLRootsPath={path to cert.pem} |
Instructs the Zing JVM to use and trust a specified SSL certificate on the filesystem. |
|||
-Xlog:[+/-]concomp |
Display messages describing communication with Optimizer Hub. |
|
Fallback to Local JIT Compilation
When you connect a Zing 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.
-
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 a Zing 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 Zing 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 Zing 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.