Optimizing Java OpenJDK

When optimizing Java applications based on OpenJDK, typically the goal is to tune the JVM from both the point of view of cost savings and quality of service.

Please refer to the Java OpenJDK optimization pack for the list of component types, parameters, metrics, and constraints.


Applying parameters

Akamas offers many operators that you can use to apply the parameters for the tuned JVM. In particular, it is suggested to use the FileConfigurator operator to create a configuration file or inject the arguments directly in the command string using a template.

The following is an example of templatized executions string:

cd "$(dirname "$0")"
java ${jvm.jvm_gcType} ${jvm.jvm_minHeapSize} ${jvm.jvm_maxHeapSize} ${jvm_newSize} ${jvm_survivorRatio} -jar renaissance.jar -r 20 --csv renaissance.csv page-rank

A typical workflow

A typical workflow to optimize a Java application can be structured in two parts:

  1. Configure the Java arguments

    1. Generate a configuration file or a command string containing the selected JVM parameters using a FileConfigurator operator.

  2. Run the Java application

    1. Use available operators to execute a performance test against the application.

Here’s an example of a typical workflow where Akamas executes the script containing the command string generated by the file configurator:

name: optimize-java-app
  - name: Configure Parameters
    operator: FileConfigurator
            hostname: app.akamas.io
            username: akamas
            path: /home/akamas/app/run.sh.templ
            key: rsa-key
          hostname: app.akamas.io
          username: akamas
          path: /home/akamas/app/run.sh
          key: rsa-key

  - name: Launch Test
    operator: Executor
      command: bash /home/akamas/app/run.sh
        hostname: app.akamas.io
        username: akamas
        key: rsa-key

Telemetry Providers

Akamas can access JMX metrics using the Prometheus provider. This provider comes out of the box with a set of default queries to interrogate a Prometheus instance configured to fetch data from a JMX Exporter.

Here’s a configuration example for a telemetry provider instance that uses Prometheus to extract all the JMX metrics defined in this optimization pack:

provider: Prometheus
  address: monitoring.akamas.io
  port: 9090

where the configuration of the monitored component provides the additional references as in the following snippet:

name: jvm
description: target JVM
componentType: openjdk-11
        instance: jvm
        job: jmx-exporter


See this page for an example of a study leveraging the Java OpenJDK pack.\

Last updated