Configuring ReadyNow Orchestrator
When you use ReadyNow Orchestrator, JVMs all write profile log candidates to unique profile names on the service. ReadyNow Orchestrator gathers all the candidates for a profile name and decides which is the best candidate to serve to JVM clients requesting that profile name.
When considering what settings are set on the client versus on the service:
-
Individual JVMs decide when ReadyNow Orchestrator should consider their profile log is a suitable candidate for sharing with other JVMs. They can also override server-side defaults for profile log nomination candidates and maximum profile log size.
-
ReadyNow Orchestrator also controls the rules for where to store ReadyNow profile logs, when to clean up old logs, and service-wide defaults for profile log candidate nomination and maximum profile log size.
Understanding ReadyNow Orchestrator Generations
With ReadyNow, you get the best results if you perform several runs of your application to generate an optimal profile. The ReadyNow Orchestrator feature in Optimizer Hub automatically takes care of creating a promoted profile as you run your application. With the default configuration, Optimizer Hub uses four runs to reach the optimal profile.
You want to make sure that the output of each training run meets minimum criteria to be promoted as the input for the next level. These promotion criteria can be:
-
The duration (time) of the training run
-
The size of the candidate profile log
When you deploy a new version of an application, ReadyNow Orchestrator automatically collects candidates from many JVMs running the same ProfileName and performs the training runs to generate the best promoted profile.
Configuring Generations
ReadyNow Orchestrator allows you to set different minimum size and recording durations for different generations of your profiles. Often you want to promote the first generation of your profile as quickly as possible, so a profile is available when new JVMs start. But you want your second generation to record for a longer time before promotion, so it is more complete.
You can use configuration settings for both ReadyNow Orchestrator itself and the JVM clients to change this behavior if the default values don’t deliver the desired result.
Basic Profile Recording with Default Generations
In its most basic form, you let the defaults do all the work and let ReadyNow Orchestrator nominate profile logs after three full generations according to these default values:
promotion:
minProfileSize: 1M
minProfileDuration: "PT2M"
minProfileSizePerGeneration: "0:1M,1:10M,2:25M,3:50M"
minProfileDurationPerGeneration: "0:PT2M,1:PT15M,2:PT30M,3:PT60M"
For example, if you want to record a new profile while deploying code to a fleet running in production. Run with the following options:
java -XX:OptHubHost={host:port} \
-XX:+EnableRNO \
-XX:ProfileName=MyApp-v3 \
-jar myapp.jar
In this case, all JVMs nominate their logs based on the defaults and keep recording until the JVM shuts down. For best results, do a test run in a canary instance for at least two minutes and, if possible, a full ten minutes. This creates generation 1 of your profile. Then restart your fleet as normal. As JVMs start up, they receive a profile from ReadyNow Orchestrator and check the generation number. If that number falls below the server-side default maximum of 3, the JVM writes out the next generation of the profile. Once there is a valid generation 3 of the profile on ReadyNow Orchestrator, none of the JVMs write any more output.
If needed, you can overrule the server-side defaults, by providing extra options to the JVM. For example:
java -XX:OptHubHost={host:port} \
-XX:+EnableRNO \
-XX:ProfileName=MyApp-v3 \
-XX:ProfileLogOutNominationMinSizePerGeneration=0:1M\,1:25M\,2:50M\,3:75M \
-XX:ProfileLogOutNominationMinTimeSec=0:PT2M\,1:PT15M\,2:PT30M\,3:PT60M \
-jar myapp.jar
Capping Profile Log Recording and Maximum Generations
We can make our example above more complex:
-
After 10 minutes you want to stop recording.
-
You want to record two generations of the profile.
Start your JVM with the following parameters:
java -XX:OptHubHost={host:port} \
-XX:+EnableRNO \
-XX:ProfileName=MyApp-v3 \
-XX:ProfileLogTimeLimitSeconds=600 \
-XX:ProfileLogOutMaxNominatedGenerationCount=2 \
-jar myapp.jar
Priority of Generation Settings
Take the default values into account when you define your own generation settings as other default settings can overrule these. Let’s look at an example:
-
You define
-XX:ProfileLogOutNominationMinTimeSec=900, but don’t change other settings. -
The server-side default for the promotion of different generations, specifies the following default
0:PT2M\,1:PT15M\,2:PT30M\,3:PT60MforreadyNowOrchestrator.promotion.minProfileDurationPerGeneration. -
As a result, the system does not promote the 2nd and 3rd generation after 900 seconds, but after 30 and 60 minutes as the defaults specify.
When you want to overrule the default settings, make sure to specify all appropriate options.
Configuring Cross-Region Synchronization of Profiles
When you deploy a separate instance of Optimizer Hub in each region, you can configure Optimizer Hub to synchronize profile names between Optimizer Hub instances so that each instance contains at least one promoted profile for each profile name. For example, when deploying a new version of your program, you may first do a canary run in one of your regions. This canary run populates the first generation of the profile for the new version’s profile name. Upon success, you want to launch a full fleet update in your other regions without doing a canary run in each region. By enabling cross-region synchronization, the profile that you wrote in the first region is now available when you launch your fleet restarts in other regions.
To enable cross-region synchronization of profiles:
-
If necessary, assign a different port to the Management Gateway component than the default 8080 using
mgmtGateway.service.httpEndpoint.port -
Define the Optimizer Hub instances that you want to synchronize by entering a comma-separated list of URLs in
synchronization.peers. -
If necessary, adjust the number of profile generations that Optimizer Hub synchronizes. By default, Optimizer Hub synchronizes the first two generations of the profile.
Check Ready Now Orchestrator Cross-Region Sync Parameters for the available configuration options.