Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this scenario, the goal is to make Renaissance run faster by optimizing the Java Virtual Machine (JVM) parameters.
The following picture represents the high-level architecture of how Akamas operates in this scenario.
In the following, you will first create a System with two components corresponding to the JVM and the Renaissance application (which only for your first studies is represented by a benchmark). Then you will create a Telemetry Instance from the CVS Telemetry Provider so as to collect metrics generated in CSV format by Renaissance. Finally, you will create a Workflow to automate the whole process of applying a benchmark configuration, launching the benchmark, collecting the resulting metrics. This will allow you to create your optimization Study to identify the optimal configuration.
Before starting, you need to login to Akamas with the following command:
How does Akamas understand when given JVM configuration is improving performance or making it worse? This is done by running optimization experiments. Thus you now need to tell Akamas how to conduct these experiments. You can do this by creating a workflow.
A workflow is a sequence of tasks that Akamas executes for every experiment, such as:
apply the parameters to an application configuration file
restart the application
launch a performance test to assess the effects of the new configuration
In the next guides you will learn how to define a workflow from the UI or to specify the YAML file to get it created from the CLI. But since the purpose of this guide is to focus on getting you started, for this time you will simply use the workflow.yaml
file provided in the repository, defined as the following:
Create the workflow by running the following command:
You can verify your new workflow has been created by accessing the corresponding Workflow menu in the UI:
You can always list all workflows and verify that they have been correctly created:
At this point, you are ready to create your optimization study.
In this section you will configure how Akamas collects metrics related to the renaissance
system. Metrics are required both to define your optimization goal (e.g.: minimize the renaissance.response_time
metric) and analyze the optimization results.
A Telemetry Provider specifies how to collect these metrics from a source, such as a monitoring platform (e.g. Prometheus or Dynatrace), a test tool (eg. Neoload or Loadrunner) or a simple CSV file. Akamas ships several out-of-the-box Telemetry Providers.
For each specific source, an instance of the corresponding Telemetry Provider needs to be defined at the system level.
The output of the Renaissance benchmark suite is a CSV report file once the benchmark completes, which includes the benchmark execution time, CPU, and memory usage. Therefore, you will now create a CSV telemetry instance.
The file tel_csv.yaml
provides the following definition:
Create the telemetry instance as follows:
You can verify your new telemetry instance under the corresponding tab within the UI:
You can always list all telemetry instances in a system and verify that they have been correctly created:
So far you have defined how the application to be optimized looks like in terms of Akamas system and components, and the telemetry required to gather the relevant metrics. Your next step is to create a workflow, that is defining how to run optimization experiments.
It's now time to set up and run our first optimization! In Akamas, an optimization is called a Study.
In this scenario, you will be creating a Study with the following properties:
The goal of the optimization will be to minimize the duration of our Renaissance benchmark - indeed for data analytics applications it's critical to reduce the time required to analyze the data and provide insights
The parameters to be optimized include just a handful of common JVM options like the heap size and the garbage collector type
The metrics that we will measure for each experiment will be the application response time and the resource consumption (CPU and memory usage)
The duration of the study will be 30 experiments, which typically takes about 1 hour
In the other guides you will learn how to define a study from the UI or to specify the YAML file to get it created from the CLI. Since the purpose of this guide is to focus on getting your started, for this time you will simply use the study-max-performance.yaml
file provided in the repository, defined as the following:
Create the study:
You can also check from the UI that you have this Study in the corresponding UI section.
Congratulations, your first Akamas study is ready to be started!
Duration: 01:00
You can now start your first study with the command:
or by accessing the Study menu in the UI, clicking on the study, and then pressing the Start button:
Notice that all steps so far can be done even without a valid installation. However, in order to start a study, you need to have a valid license installed. See Install the license
Congratulations, your first Akamas study is now running!
You can follow the progress of the study from the UI by selecting the Progress tab:
The Progress tab also allows following the workflow tasks execution, including logs for troubleshooting:
You can also execute the following command from time to time:
This optimization study is expected to automatically run all its experiments for about 1 hour. Of course, this may vary depending on your specific system and study configuration.
Notice that you can always stop (and restart) a study before all experiments are completed. This can be done by using the Stop button in the UI.
or by executing the following command:
Notice: while Akamas is running experiments, it may happen that a bad configuration results in an error such as Java OutOfMemoryError or similar. When that happens, the experiment is marked as failed. But don't worry! Akamas AI learns from those failures and it automatically takes them into account in order to quickly explore the most promising areas of the optimization space.
You can now analyze the partial results of the optimization study as its experiments progress.
You can now look at the results of your first AI-driven performance optimization study.
Notice: in your environment, you might achieve different results with respect to what is described in this guide. The actual best configuration might depend on your actual setup - operating systems, cloud or virtualization platform, and the hardware
Select your study from the UI Study menu.
The Summary tab displays high-level study information at a glance, including the best score obtained so far, a summary of the optimized parameters, and their values for the best configuration.
By optimally configuring the JVM parameters, Akamas was able to cut the application response time by almost 41%:
The Analysis tab shows the experiments' score over time.
Properly tuning a modern JVM is a complex challenge, and might require weeks of time and effort even for performance experts.
Akamas AI is designed to converge rapidly toward optimal configurations. In this case, Akamas was able to find the optimal JVM configuration after only 30 automated performance experiments:
Below the optimization chart, you can also find a table showing aggregated performance metrics and parameters set for each experiment. For each metric, you can find a percentage variation with respect to the baseline experiment, so that you can quickly see the impact the new parameters had on other interesting key metrics (you can sort them too).
The Insights drawer lets you explore the additional benefits of the configurations Akamas explored with respect to other key metrics besides the goal. Choose some KPIs in the study's main page to discover the insights.
In this optimization, the best configurations Akamas found not only made the application run significantly faster, but also made the application run more efficiently on the CPU:
From a CPU efficiency perspective, the best configuration Akamas found was able to cut CPU utilization by 33%, while still improving response time by 17%.
What are the best JVM settings Akamas found that made the application run so much faster?
You can find them in the Best Configuration table in the Summary tab.
Without being told anything about how the application works, Akamas learned the best settings for some interesting JVM parameters:
the max heap size was slightly changed
the best garbage collector is Parallel
Those are not easy insights to discover, without being an expert and doing dozens of manual performance experiments!
The Metrics tab allows you to check the metrics that the telemetry modules collected over time for each experiment. In the chart, Akamas presents you with a comparison of the key metrics related to the baseline and the best experiment (you can add more using the filters).
Despite this first optimization relying on short benchmark execution times, the best configuration is consistently faster than the baseline.
Congratulations! You have just completed your first Akamas optimization of a sample Java application!
First of all, let's create a System.
In the provided repository you can find a file called system.yaml
with the following content:
Create the corresponding system as follows:
You can directly see it in the UI under the Systems menu:
You can always list all systems and verify that a system has been correctly created:
At this point, you need to add the two components corresponding to the JVM and the Renaissance application. For both these components you can take advantage of the corresponding pre-defined Optimization Packs. An Optimization Pack provides for each specific technology the recommended Parameters, Metrics, and Telemetry Providers.
Since Renaissance is a Java-based application, we can take advantage of the corresponding Akamas Optimization Pack.
In order to install the Akamas Optimization Pack for Java OpenJDK 11, you can either run the following command
or simply operate from the UI, by installing it from the section listing all the Optimization Packs available in your installation:
which should result in this Optimization Pack being installed (and thus possibly ready to be de-installed)
Notice: you only need to install an Optimization Pack once. So if an Optimization Pack has already been installed there is no need to follow these instructions once again. You can verify which Optimization Packs are already installed directly from the UI or by executing the following command:
Now that the Optimization Pack has been installed, you can create the JVM component for this system.
The file comp_jvm.yaml
contains the following definition for our system:
Create the corresponding component for the renaissance
system:
You can now see the JVM component in the UI:
You can always list all components in a system and verify that they have been correctly created:
At this point, you can install the Optimization Pack for Renaissance. This Optimization Pack is needed to tell Akamas which metrics you are going to optimize. Our goal for this study is to minimize the benchmark response time, and to do so you need to create a component with the response time metric. For each benchmark execution, we will also track the CPU and memory usage of the Java process, so in the Optimization Pack we have included those metrics as well.
Let's now install the Renaissance Optimization Pack. This time, you will use a JSON file already provided in the Akamas-in-a-box installation (or if you're using a cloud instance from your laptop, you can download it from our GitHub repository here):
You can easily create new Optimization Packs with the Akamas CLI to optimize your application-specific parameters! See the akamas build optimization-pack
command to create the JSON file, and the product documentation to learn more.
Now you can create the renaissance
component.
The file comp_renaissance.yaml
defines the component as follows:
Create the component by specifying the YAML file and the name of the system renaissance
:
You can now see the renaissance component and the associated response time, CPU, and memory usage metrics:
Now we need to move to the next step and define where to collect metrics for this system.
In this guide, you will learn how to optimize the performance of your first Java application with Akamas.
For your very first optimization, the target application will be Renaissance, a sample Java benchmark that comes already shipped with Akamas-in-a-box - no need to install anything! The optimization goal is to make Renaissance run faster (minimize the response time of the benchmark iterations). You will leverage Akamas to automatically identify the optimal JVM parameters (like the size of the heap and inner pools, type of garbage collector, etc.) that can speed up the application.
Enjoy your first optimization exercise on a simple benchmark application. Once you have completed your first optimizations, make sure to check out the other quick guides to feel the power of Akamas applied to real-world optimization scenarios.
Get ready for your first optimization!
How to optimize the performance of a Java application
The main Akamas concepts: system, optimization pack, telemetry instance, workflow and optimization study
How to interact with Akamas through the CLI and web UI
How to create, list, and delete Akamas resources
An Akamas instance installed with a valid license - see the Akamas In a Box guide
Basic understanding of Akamas - you can watch a 2m video in the Welcome to Akamas guide.
Notice: all the configuration files used in this guide can be found on our public GitHub repository.