Comment on page
Optimizing a sample Linux system
In this study, Akamas is tasked with the optimization of Linux1, a Linux-based system (Ubuntu). The study's goal is to maximize the throughput of the computations of the Sysbench CPU benchmark.
Sysbench is a suite of benchmarks for CPU, file system, memory, threads, etc… typically used for testing the performance of databases.
System1 comes with a Node Exporter that collects system metrics that Akamas consumes through a Prometheus provider. Concerning Sysbench metrics, The study uses the CSV provider to make them available to Akamas.
The study uses Sysbench to execute a performance test against System1.
- 1.Setup a Prometheus and a Node Exporter to monitor the System
- 2.Install the Prometheus provider
- 3.Create a provider instance:
1
provider: "Prometheus"
2
config:
3
address: "linux1" # address of the Prometheus of system1
4
port: 9090 # port of the Prometheus of system1
5
component: "linux1-linux"
4. Install the CSV File provider.
5. Create a provider instance:
1
provider: "CSV"
2
config:
3
address: "linux1"
4
authType: "password"
5
username: "ubuntu"
6
auth: "[INSERT PASSWORD HERE]"
7
protocol: scp
8
remoteFilePattern: "/home/ubuntu/benchmark_log.csv" # the remote path of the csv with the metrics of the benchmark
9
componentColumn: "component" # which column of the csv should contain the name of the component
10
csvFormat: "horizontal"
11
metrics:
12
- metric: "throughput"
13
datasourceMetric: "events_per_second"
The study uses a four-task workflow to test System1 with a new configuration:
- 1.Task Configure OS, which leverages the LinuxConfigurator operator to apply a new set of Linux configuration parameters
- 2.
The following YAML file represents the complete workflow definition:
1
name: "workflow for linux 1"
2
tasks
3
- name: "Configure OS"
4
operator: "LinuxConfigurator"
5
arguments:
6
component: linux1-linux
7
8
- name: "Start benchmark"
9
operator: "Executor"
10
arguments:
11
command: "bash /home/ubuntu/benchmark.sh"
12
host:
13
hostname: "linux1"
14
username: "ubuntu"
15
password: "[INSERT_HERE_PASSWORD]"
Within Akamas, System1 is modeled by a system of two components:
- system1-linux, which represents the actual Linux system with its metrics and parameters and is of type Ubuntu 16.04
- system1-bench, which represents the Sysbench with its metrics and is of type Sysbench
The following YAML file represents the definition of the Sysbench component type:
1
name: "Sysbench"
2
description: "A component-type for Sysbench"
3
metrics:
4
- "throughput" # only one metric
- Goal: minimize the throughput of the benchmark
- Windowing: take the default (compute the score for the entire duration of a trial)
- Parameters selection: select only CPU scheduling parameters
- Metrics selection: select only the throughput of the benchmark
- Trials: 3
- Steps: one baseline and one optimize
The following YAML file represents the definition of the study:
1
system: "system for linux1"
2
workflow: "workflow ofr linux1"
3
name: "linux optimization with sysbench"
4
description: "Optimizing an Ubuntu instance with a CPU intensive benchmark: sysbench"
5
goal:
6
objective: minimize
7
function:
8
formula: "linux1-benchmark.throughput"
9
metricsSelection:
10
- "linux1-benchmark.throughput"
11
parametersSelection:
12
- name: "linux1-linux.os_cpuSchedMinGranularity"
13
- name: "linux1-linux.os_cpuSchedWakeupGranularity"
14
- name: "linux1-linux.os_CPUSchedMigrationCost"
15
- name: "linux1-linux.os_CPUSchedChildRunsFirst"
16
- name: "linux1-linux.os_CPUSchedLatency"
17
- name: "linux1-linux.os_CPUSchedAutogroupEnabled"
18
- name: "linux1-linux.os_CPUSchedNrMigrate"
19
numberOfTrials: 3
20
steps:
21
- name: "baseline"
22
type: "baseline"
23
values:
24
linux1-linux.os_cpuSchedMinGranularity: 2250000
25
linux1-linux.os_cpuSchedWakeupGranularity: 3000000
26
linux1-linux.os_CPUSchedMigrationCost: 500000
27
linux1-linux.os_CPUSchedChildRunsFirst: 0
28
linux1-linux.os_CPUSchedLatency: 18000000
29
linux1-linux.os_CPUSchedAutogroupEnabled: 1
30
linux1-linux.os_CPUSchedNrMigrate: 32
31
- name: "optimization"
32
type: "optimize"
33
numberOfExperiments: 99
34
maxFailedExperiments: 25