Installing Optimizer Hub with Compilation Streaming
Compilation Streaming lets a JVM download a stream of previously performed compilations from Optimizer Hub at startup and install them directly, instead of requesting each compilation individually as the application warms up. This shortens the time needed to clear the compilation queue and reduces load on Cloud Native Compiler.
Compilation Streaming must be enabled on both the Optimizer Hub server and the JVM. This page gives the complete commands for both. For how the feature works, its full configuration options, and its metrics, see Using Compilation Streaming.
Compilation Streaming requires:
-
Optimizer Hub 26.08.0 or newer on the server.
-
Azul Zing 26.08.1.0 or newer on the client.
-
A promoted ReadyNow profile for the profile name your JVMs use. See Compilation Streaming Requires a Promoted Profile.
Step 1: Enable Compilation Streaming on the Server
Compilation Streaming requires one setting. Either add it to your values-override.yaml:
compilationStreaming:
enabled: true
Or pass the values-comp-stream.yaml file shipped with the Helm chart, which contains the same setting.
The task-executor pod that builds the streams is deployed by default, so no second setting is needed.
|
Important
|
If you disabled task-executor in your values-override.yaml, re-enable it with taskExecutor.enabled: true. Without it, the streaming endpoints start correctly but no streams are ever built, and JVMs continue without streaming and without reporting an error.
|
New Installation
helm install opthub opthub-helm/azul-opthub \
-n my-opthub \
-f values-override.yaml \
-f values-comp-stream.yaml \
--version 26.08.0
Existing Installation
To enable Compilation Streaming on a running Optimizer Hub instance, use the same files and settings as your original installation and replace install with upgrade:
helm upgrade opthub opthub-helm/azul-opthub \
-n my-opthub \
-f values-override.yaml \
-f values-comp-stream.yaml \
--version 26.08.0
Step 2: Verify the Server
Check that the task-executor pod is running:
kubectl get pods -n my-opthub | grep task-executor
Step 3: Enable Compilation Streaming on the JVM
Add -XX:+CNCEnableCompilationStreaming to the JVM options of your application, alongside the options that connect it to Optimizer Hub and set its ReadyNow profile name:
java -XX:OptHubHost=<host>:<port> \
-XX:+EnableRNO \
-XX:ProfileName=<profile-name> \
-XX:+CNCEnableCompilationStreaming \
-jar my-app.jar
Optimizer Hub builds each stream from its Code Cache and the promoted ReadyNow profile for a given profile name, so the JVM must use the same -XX:ProfileName as the profile the stream was built from. For the other options that connect a JVM to Optimizer Hub, see Connecting a JVM to Optimizer Hub and Using ReadyNow Orchestrator.
At startup the JVM asks whether a stream exists for its profile. If one does, the JVM uses it. If not, the JVM runs normally without streaming and no error is reported.
Step 4: Verify the Client
Streaming statistics appear in the JVM’s GC log in the COMPSTREAMSTATS line, covering lookups, hits, misses, installation outcomes, segments loaded and evicted, and bytes downloaded. The hit rate derived from these values is the main indicator of whether streaming is working well for an application.
Compilation Streaming Requires a Promoted Profile
Optimizer Hub can only provide a stream after a ReadyNow profile has been promoted for the given profile name. If the promotion criteria configured for your deployment are never met, no stream is ever built, and JVMs continue without streaming.
This is not reported as an error. A JVM that finds no stream for its profile starts normally and the application behaves correctly, so an instance that appears healthy may not be using Compilation Streaming at all. If COMPSTREAMSTATS shows no hits, confirm that a promoted profile exists for your profile name before investigating anything else.
Promotion criteria are set per generation and are configurable, so how long promotion takes depends on your deployment. See Understanding ReadyNow Orchestrator Generations.
|
Note
|
A profile that you upload manually is promoted immediately, regardless of the configured promotion rules. See Uploading a Profile through the API. |
|
Important
|
A single JVM cannot use both Compilation Streaming and Indirect Delivery of ReadyNow profiles. See Compilation Streaming and Indirect Delivery. |