[AIAS-03] Create the Study

It's now time to define the optimization study. The overall objective is to increase the cost efficiency of the application, without impacting application reliability in terms of response time or error rates.

To achieve that objective, you create an Akamas study with the goal of maximizing the ratio between application throughput and cloud cost, where:

  • application throughput is the transactions per second as measured by the load-testing tool

  • cloud cost is the total cost to run Kubernetes microservices on the cloud, and is a function of the CPU and memory requests assigned to each container. We assume a sample pricing of $29 per CPU core/month and $3.2 per memory GB/month.

Hence, a good configuration is one that either increases throughput with the same cloud cost, or that keeps throughput constant but with a lower cloud cost.

To avoid impacting application reliability, you can define Akamas metric constraints on transaction response time lower than 500 milliseconds and error rate below 2%.

Here is the relevant section of the study:

goal:
  objective: maximize
  function:
    formula: online_boutique.transactions_throughput / online_boutique.cost
  constraints:
    absolute: 
      - name: response_time
        formula: online_boutique.transactions_response_time <= 500
      - name: error_rate
        formula: online_boutique.transactions_error_rate <= 0.02

As regard the parameters to optimize, in this example Akamas is tuning CPU and memory limits (requests are set equal to the limits) of each deployment in the Online Boutique application, for a total of 22 parameters. Here is the relevant section of the study:

parametersSelection:
  - name: frontend.cpu_limit
    domain: [100, 300]
  - name: frontend.memory_limit
    domain: [64, 512]
  - name: adservice.cpu_limit
    domain: [100, 300]
  - name: adservice.memory_limit
    domain: [64, 512]
    ...

You can review the complete optimization study by looking at the study.yaml file in the akamas/studies folder.

You can now create the optimization study:

akamas create study kubernetes-online-boutique/akamas/studies/study.yaml

and then start the optimization:

akamas start study 'Maximizing Kubernetes Online Boutique cost efficiency while matching SLOs'

You can now explore this study from the Study menu in the Akamas UI and then move to the Analysis tab.

As the optimization study executes the different experiments, this chart will display more points and their associated score.

Last updated