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={value} and -XX:+CNCEnableRemoteCompiler . It’s also advised to specify -XX:ProfileName=<value> for improved Cloud Native Compiler caching.
|
Command Line Option | Description | Default | ||
---|---|---|---|---|
-XX:OptHubHost=<host>[:<port>] |
|
null |
||
-XX:[+/-]CNCEnableRemoteCompiler |
|
|||
-XX:ProfileName=<value> |
Name of the profile associated with the application running on the JVM. This name allows multiple JVM instances that use the same profile name to share the Optimizer Hub functionality, such as the Cloud Native Compiler caching. |
null |
||
-XX:CNCEngineUploadAddress=<host:port> |
Address to upload the compiler engine. Only needed when your Optimizer Hub has non-standard ports.
|
|||
-XX:[+/-]CNCStartWithLocalCompiler |
Enables the Falcon compiler at JVM startup and then disables it only upon failure to connect to Cloud Native Compiler. |
true |
||
-XX:CNCLocalFallbackOptLevelLimit=<3,2,1,0> |
Limit the OptLevel for local compilations when Cloud Native Compiler is enabled. See the Zing documentation > Falcon Compiler Options > -XX:FalconOptimizationLevel. |
|
||
-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 the Cloud Native Compiler component is not available, the Zing JVM falls back to local compilation.
Fallback Reasons
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.
Considerations Regarding Correct Fallback
You need to take the following conditions under consideration before you start using Cloud Native Compiler:
-
Your environment must have monitoring tools and measurable success criteria to monitor:
-
Response latencies.
-
CPU utilization.
-
Outages or problems when restarting fleets under normal operations.
-
-
Your application must be able to handle switching between Cloud Native Compiler and local fallback. This means it can handle these potentially circumstances:
-
Response latencies and CPU utilization can be lower but should still be within your acceptable limits.
-
The time to full speed will likely be longer.
-
The carrying capacity of each server is lower, so more instances need to be provisioned to handle an identical load.
-
You can prevent critical outages related to pods starting and/or Cloud Native Compiler not being available by using different levels for -XX:CNCLocalFallbackOptLevelLimit=<3,2,1,0>
to tune your local fallback and limit the number of compiler threads after the warmup period.
Automatic Switch Back to Cloud Native Compiler
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 Zing 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.