补充用户手册英文版
19
docs/en/24.03_LTS_SP2/_toc.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
label: A-Tune User Guide
|
||||
isManual: true
|
||||
description: Optimized openEuler performance through AI-powered, automated tuning
|
||||
sections:
|
||||
- label: A-Tune User Guide
|
||||
href: ./a_tune.md
|
||||
sections:
|
||||
- label: Getting to Know A-Tune
|
||||
href: ./getting_to_know_a_tune.md
|
||||
- label: Installation and Deployment
|
||||
href: ./installation_and_deployment.md
|
||||
- label: Usage Instructions
|
||||
href: ./usage_instructions.md
|
||||
- label: Native-Turbo
|
||||
href: ./native_turbo.md
|
||||
- label: Appendix
|
||||
href: ./appendix.md
|
||||
- label: Common Issues and Solutions
|
||||
href: ./faqs_and_solutions.md
|
||||
5
docs/en/24.03_LTS_SP2/a_tune.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# A-Tune User Guide
|
||||
|
||||
This document describes how to install and use A-Tune, which is a performance self-optimization software for openEuler.
|
||||
|
||||
This document is intended for developers, open-source enthusiasts, and partners who use the openEuler system and want to know and use A-Tune. You need to have basic knowledge of the Linux OS.
|
||||
19
docs/en/24.03_LTS_SP2/appendix.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Appendix
|
||||
|
||||
## Acronyms and Abbreviations
|
||||
|
||||
**Table 1** Terminology
|
||||
|
||||
<table><thead align="left"><tr id="row4517946163817"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p951884613382"><a name="p951884613382"></a><a name="p951884613382"></a>Term</p>
|
||||
</th>
|
||||
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p14518114693817"><a name="p14518114693817"></a><a name="p14518114693817"></a>Description</p>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr id="row20518154612386"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p4518144612386"><a name="p4518144612386"></a><a name="p4518144612386"></a>profile</p>
|
||||
</td>
|
||||
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17597758162211"><a name="p17597758162211"></a><a name="p17597758162211"></a>Set of optimization items and optimal parameter configuration.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
52
docs/en/24.03_LTS_SP2/faqs_and_solutions.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Common Issues and Solutions
|
||||
|
||||
## Issue 1: An error occurs when the **train** command is used to train a model, and the message "training data failed" is displayed
|
||||
|
||||
Cause: Only one type of data is collected by using the **collection**command.
|
||||
|
||||
Solution: Collect data of at least two data types for training.
|
||||
|
||||
## Issue 2: atune-adm cannot connect to the atuned service
|
||||
|
||||
Possible cause:
|
||||
|
||||
1. Check whether the atuned service is started and check the atuned listening address.
|
||||
|
||||
```shell
|
||||
systemctl status atuned
|
||||
netstat -nap | grep atuned
|
||||
```
|
||||
|
||||
2. The firewall blocks the atuned listening port.
|
||||
3. The HTTP proxy is configured in the system. As a result, the connection fails.
|
||||
|
||||
Solution:
|
||||
|
||||
1. If the atuned service is not started, run the following command to start the service:
|
||||
|
||||
```shell
|
||||
systemctl start atuned
|
||||
```
|
||||
|
||||
2. Run the following command on the atuned and atune-adm servers to allow the listening port to receive network packets. In the command, **60001** is the listening port number of the atuned server.
|
||||
|
||||
```shell
|
||||
iptables -I INPUT -p tcp --dport 60001 -j ACCEPT
|
||||
iptables -I INPUT -p tcp --sport 60001 -j ACCEPT
|
||||
```
|
||||
|
||||
3. Run the following command to delete the HTTP proxy or disable the HTTP proxy for the listening IP address without affecting services:
|
||||
|
||||
```shell
|
||||
no_proxy=$no_proxy, Listening_IP_address
|
||||
```
|
||||
|
||||
## Issue 3: The atuned service cannot be started, and the message "Job for atuned.service failed because a timeout was exceeded." is displayed
|
||||
|
||||
Cause: The hosts file does not contain the localhost information.
|
||||
|
||||
Solution: Add localhost to the line starting with **127.0.0.1** in the **/etc/hosts** file.
|
||||
|
||||
```text
|
||||
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
|
||||
```
|
||||
BIN
docs/en/24.03_LTS_SP2/figures/picture1.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/picture4.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0213178479.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0213178480.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0214540398.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0227497000.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0227497343.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0231122163.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
docs/en/24.03_LTS_SP2/figures/zh-cn_image_0245342444.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
63
docs/en/24.03_LTS_SP2/getting_to_know_a_tune.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Getting to Know A-Tune
|
||||
|
||||
## Introduction
|
||||
|
||||
An operating system \(OS\) is basic software that connects applications and hardware. It is critical for users to adjust OS and application configurations and make full use of software and hardware capabilities to achieve optimal service performance. However, numerous workload types and varied applications run on the OS, and the requirements on resources are different. Currently, the application environment composed of hardware and software involves more than 7000 configuration objects. As the service complexity and optimization objects increase, the time cost for optimization increases exponentially. As a result, optimization efficiency decreases sharply. Optimization becomes complex and brings great challenges to users.
|
||||
|
||||
Second, as infrastructure software, the OS provides a large number of software and hardware management capabilities. The capability required varies in different scenarios. Therefore, capabilities need to be enabled or disabled depending on scenarios, and a combination of capabilities will maximize the optimal performance of applications.
|
||||
|
||||
In addition, the actual business embraces hundreds and thousands of scenarios, and each scenario involves a wide variety of hardware configurations for computing, network, and storage. The lab cannot list all applications, business scenarios, and hardware combinations.
|
||||
|
||||
To address the preceding challenges, openEuler launches A-Tune.
|
||||
|
||||
A-Tune is an AI-based engine that optimizes system performance. It uses AI technologies to precisely profile business scenarios, discover and infer business characteristics, so as to make intelligent decisions, match with the optimal system parameter configuration combination, and give recommendations, ensuring the optimal business running status.
|
||||
|
||||

|
||||
|
||||
## Architecture
|
||||
|
||||
The following figure shows the A-Tune core technical architecture, which consists of intelligent decision-making, system profile, and interaction system.
|
||||
|
||||
- Intelligent decision-making layer: consists of the awareness and decision-making subsystems, which implements intelligent awareness of applications and system optimization decision-making, respectively.
|
||||
- System profile layer: consists of the feature engineering and two-layer classification model. The feature engineering is used to automatically select service features, and the two-layer classification model is used to learn and classify service models.
|
||||
- Interaction system layer: monitors and configures various system resources and executes optimization policies.
|
||||
|
||||

|
||||
|
||||
## Supported Features and Service Models
|
||||
|
||||
### Supported Features
|
||||
|
||||
[Table 1](#table1919220557576) describes the main features supported by A-Tune, feature maturity, and usage suggestions.
|
||||
|
||||
**Table 1** Feature maturity
|
||||
|
||||
<a name="table1919220557576"></a>
|
||||
|
||||
| Feature | Maturity | Usage Suggestion |
|
||||
| --------------------------------------------------------- | -------- | ---------------- |
|
||||
| Auto optimization of 15 applications in 11 workload types | Tested | Pilot |
|
||||
| User-defined profile and service models | Tested | Pilot |
|
||||
| Automatic parameter optimization | Tested | Pilot |
|
||||
|
||||
### Supported Service Models
|
||||
|
||||
Based on the workload characteristics of applications, A-Tune classifies services into 11 types. For details about the bottleneck of each type and the applications supported by A-Tune, see [Table 2](#table2819164611311).
|
||||
|
||||
**Table 2** Supported workload types and applications
|
||||
|
||||
<a name="table2819164611311"></a>
|
||||
|
||||
| Service category | Type | Bottleneck | Supported Application |
|
||||
| ------------------ | -------------------- | ------------------------------------------------------------ | ----------------------------------- |
|
||||
| default | Default type | Low resource usage in terms of cpu, memory, network, and I/O | N/A |
|
||||
| webserver | Web application | Bottlenecks of cpu and network | Nginx, Apache Traffic Server |
|
||||
| database | Database | Bottlenecks of cpu, memory, and I/O | Mongodb, Mysql, Postgresql, Mariadb |
|
||||
| big_data | Big data | Bottlenecks of cpu and memory | Hadoop-hdfs, Hadoop-spark |
|
||||
| middleware | Middleware framework | Bottlenecks of cpu and network | Dubbo |
|
||||
| in-memory_database | Memory database | Bottlenecks of memory and I/O | Redis |
|
||||
| basic-test-suite | Basic test suite | Bottlenecks of cpu and memory | SPECCPU2006, SPECjbb2015 |
|
||||
| hpc | Human genome | Bottlenecks of cpu, memory, and I/O | Gatk4 |
|
||||
| storage | Storage | Bottlenecks of network, and I/O | Ceph |
|
||||
| virtualization | Virtualization | Bottlenecks of cpu, memory, and I/O | Consumer-cloud, Mariadb |
|
||||
| docker | Docker | Bottlenecks of cpu, memory, and I/O | Mariadb |
|
||||
509
docs/en/24.03_LTS_SP2/installation_and_deployment.md
Normal file
@@ -0,0 +1,509 @@
|
||||
# Installation and Deployment
|
||||
|
||||
This chapter describes how to install and deploy A-Tune.
|
||||
|
||||
## Software and Hardware Requirements
|
||||
|
||||
### Hardware Requirement
|
||||
|
||||
- Huawei Kunpeng 920 processor
|
||||
|
||||
### Software Requirement
|
||||
|
||||
- OS: openEuler 22.03
|
||||
|
||||
## Environment Preparation
|
||||
|
||||
For details about installing an openEuler OS, see the [_openEuler Installation Guide_](../../../installation_upgrade/installation/installation_on_servers.md).
|
||||
|
||||
## A-Tune Installation
|
||||
|
||||
This section describes the installation modes and methods of the A-Tune.
|
||||
|
||||
### Installation Modes
|
||||
|
||||
A-Tune can be installed in single-node, distributed, and cluster modes.
|
||||
|
||||
- Single-node mode
|
||||
|
||||
The client and server are installed on the same system.
|
||||
|
||||
- Distributed mode
|
||||
|
||||
The client and server are installed on different systems.
|
||||
|
||||
- Cluster mode
|
||||
A cluster consists of a client and more than one servers.
|
||||
|
||||
The installation modes are as follows:
|
||||
|
||||

|
||||
|
||||
### Installation Procedure
|
||||
|
||||
To install the A-Tune, perform the following steps:
|
||||
|
||||
1. Mount an openEuler ISO image.
|
||||
|
||||
```shell
|
||||
mount openEuler-22.03-LTS-everything-x86_64-dvd.iso /mnt
|
||||
```
|
||||
|
||||
> Use the **everything** ISO image.
|
||||
|
||||
2. Configure the local Yum source.
|
||||
|
||||
```shell
|
||||
vim /etc/yum.repos.d/local.repo
|
||||
```
|
||||
|
||||
The configured contents are as follows:
|
||||
|
||||
```conf
|
||||
[local]
|
||||
name=local
|
||||
baseurl=file:///mnt
|
||||
gpgcheck=1
|
||||
enabled=1
|
||||
```
|
||||
|
||||
3. Import the GPG public key of the RPM digital signature to the system.
|
||||
|
||||
```shell
|
||||
rpm --import /mnt/RPM-GPG-KEY-openEuler
|
||||
```
|
||||
|
||||
4. Install an A-Tune server.
|
||||
|
||||
> [!NOTE]NOTE
|
||||
> In this step, both the server and client software packages are installed. For the single-node deployment, skip **Step 5**.
|
||||
|
||||
```shell
|
||||
yum install atune -y
|
||||
yum install atune-engine -y
|
||||
```
|
||||
|
||||
5. For a distributed mode, install an A-Tune client on associated server.
|
||||
|
||||
```shell
|
||||
yum install atune-client -y
|
||||
```
|
||||
|
||||
6. Check whether the installation is successful.
|
||||
|
||||
```shell
|
||||
$ rpm -qa | grep atune
|
||||
atune-client-xxx
|
||||
atune-db-xxx
|
||||
atune-xxx
|
||||
atune-engine-xxx
|
||||
```
|
||||
|
||||
If the preceding information is displayed, the installation is successful.
|
||||
|
||||
## A-Tune Deployment
|
||||
|
||||
This section describes how to deploy A-Tune.
|
||||
|
||||
### Overview
|
||||
|
||||
The configuration items in the A-Tune configuration file **/etc/atuned/atuned.cnf** are described as follows:
|
||||
|
||||
- A-Tune service startup configuration (modify the parameter values as required).
|
||||
|
||||
- **protocol**: Protocol used by the gRPC service. The value can be **unix** or **tcp**. **unix** indicates the local socket communication mode, and **tcp** indicates the socket listening port mode. The default value is **unix**.
|
||||
- **address**: Listening IP address of the gRPC service. The default value is **unix socket**. If the gRPC service is deployed in distributed mode, change the value to the listening IP address.
|
||||
- **port**: Listening port of the gRPC server. The value ranges from 0 to 65535. If **protocol** is set to **unix**, you do not need to set this parameter.
|
||||
- **connect**: IP address list of the nodes where the A-Tune is located when the A-Tune is deployed in a cluster. IP addresses are separated by commas (,).
|
||||
- **rest_host**: Listening address of the REST service. The default value is localhost.
|
||||
- **rest_port**: Listening port of the REST service. The value ranges from 0 to 65535. The default value is 8383.
|
||||
- **engine_host**: IP address for connecting to the A-Tune engine service of the system.
|
||||
- **engine_port**: Port for connecting to the A-Tune engine service of the system.
|
||||
- **sample_num**: Number of samples collected when the system executes the analysis process. The default value is 20.
|
||||
- **interval**: Interval for collecting samples when the system executes the analysis process. The default value is 5s.
|
||||
- **grpc_tls**: Indicates whether to enable SSL/TLS certificate verification for the gRPC service. By default, this function is disabled. After grpc_tls is enabled, you need to set the following environment variables before running the **atune-adm** command to communicate with the server:
|
||||
- export ATUNE_TLS=yes
|
||||
- export ATUNED_CACERT=\<Path of the client CA certificate>
|
||||
- export ATUNED_CLIENTCERT=\<Client certificate path>
|
||||
- export ATUNED_CLIENTKEY=\<Client key path>
|
||||
- export ATUNED_SERVERCN=server
|
||||
- **tlsservercafile**: Path of the gPRC server's CA certificate.
|
||||
- **tlsservercertfile**: Path of the gPRC server certificate.
|
||||
- **tlsserverkeyfile**: Path of the gPRC server key.
|
||||
- **rest_tls**: Indicates whether to enable SSL/TLS certificate verification for the REST service. This function is enabled by default.
|
||||
- **tlsrestcacertfile**: Path of the server's CA certificate of the REST service.
|
||||
- **tlsrestservercertfile**: Path of the server certificate of the REST service.
|
||||
- **tlsrestserverkeyfile**: Indicates the key path of the REST service.
|
||||
- **engine_tls**: Indicates whether to enable SSL/TLS certificate verification for the A-Tune engine service. This function is enabled by default..
|
||||
- **tlsenginecacertfile**: Path of the client CA certificate of the A-Tune engine service.
|
||||
- **tlsengineclientcertfile**: Client certificate path of the A-Tune engine service.
|
||||
- **tlsengineclientkeyfile**: Client key path of the A-Tune engine service.
|
||||
|
||||
- System information
|
||||
|
||||
System is the parameter information required for system optimization. You must modify the parameter information according to the actual situation.
|
||||
|
||||
- **disk**: Disk information to be collected during the analysis process or specified disk during disk optimization.
|
||||
- **network**: NIC information to be collected during the analysis process or specified NIC during NIC optimization.
|
||||
- **user**: User name used for ulimit optimization. Currently, only the user **root** is supported.
|
||||
|
||||
- Log information
|
||||
|
||||
Change the log level as required. The default log level is info. Log information is recorded in the **/var/log/messages** file.
|
||||
|
||||
- Monitor information
|
||||
|
||||
Hardware information that is collected by default when the system is started.
|
||||
|
||||
- Tuning information
|
||||
|
||||
Tuning is the parameter information required for offline tuning.
|
||||
|
||||
- **noise**: Evaluation value of Gaussian noise.
|
||||
- **sel_feature**: Indicates whether to enable the function of generating the importance ranking of offline tuning parameters. By default, this function is disabled.
|
||||
|
||||
#### Example
|
||||
|
||||
```conf
|
||||
#################################### server ###############################
|
||||
# atuned config
|
||||
[server]
|
||||
# the protocol grpc server running on
|
||||
# ranges: unix or tcp
|
||||
protocol = unix
|
||||
|
||||
# the address that the grpc server to bind to
|
||||
# default is unix socket /var/run/atuned/atuned.sock
|
||||
# ranges: /var/run/atuned/atuned.sock or ip address
|
||||
address = /var/run/atuned/atuned.sock
|
||||
|
||||
# the atune nodes in cluster mode, separated by commas
|
||||
# it is valid when protocol is tcp
|
||||
# connect = ip01,ip02,ip03
|
||||
|
||||
# the atuned grpc listening port
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
# port = 60001
|
||||
|
||||
# the rest service listening port, default is 8383
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
rest_host = localhost
|
||||
rest_port = 8383
|
||||
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = localhost
|
||||
engine_port = 3838
|
||||
|
||||
# when run analysis command, the numbers of collected data.
|
||||
# default is 20
|
||||
sample_num = 20
|
||||
|
||||
# interval for collecting data, default is 5s
|
||||
interval = 5
|
||||
|
||||
# enable gRPC authentication SSL/TLS
|
||||
# default is false
|
||||
# grpc_tls = false
|
||||
# tlsservercafile = /etc/atuned/grpc_certs/ca.crt
|
||||
# tlsservercertfile = /etc/atuned/grpc_certs/server.crt
|
||||
# tlsserverkeyfile = /etc/atuned/grpc_certs/server.key
|
||||
|
||||
# enable rest server authentication SSL/TLS
|
||||
# default is true
|
||||
rest_tls = true
|
||||
tlsrestcacertfile = /etc/atuned/rest_certs/ca.crt
|
||||
tlsrestservercertfile = /etc/atuned/rest_certs/server.crt
|
||||
tlsrestserverkeyfile = /etc/atuned/rest_certs/server.key
|
||||
|
||||
# enable engine server authentication SSL/TLS
|
||||
# default is true
|
||||
engine_tls = true
|
||||
tlsenginecacertfile = /etc/atuned/engine_certs/ca.crt
|
||||
tlsengineclientcertfile = /etc/atuned/engine_certs/client.crt
|
||||
tlsengineclientkeyfile = /etc/atuned/engine_certs/client.key
|
||||
|
||||
|
||||
#################################### log ###############################
|
||||
[log]
|
||||
# either "debug", "info", "warn", "error", "critical", default is "info"
|
||||
level = info
|
||||
|
||||
#################################### monitor ###############################
|
||||
[monitor]
|
||||
# with the module and format of the MPI, the format is {module}_{purpose}
|
||||
# the module is Either "mem", "net", "cpu", "storage"
|
||||
# the purpose is "topo"
|
||||
module = mem_topo, cpu_topo
|
||||
|
||||
#################################### system ###############################
|
||||
# you can add arbitrary key-value here, just like key = value
|
||||
# you can use the key in the profile
|
||||
[system]
|
||||
# the disk to be analysis
|
||||
disk = sda
|
||||
|
||||
# the network to be analysis
|
||||
network = enp189s0f0
|
||||
|
||||
user = root
|
||||
|
||||
#################################### tuning ###############################
|
||||
# tuning configs
|
||||
[tuning]
|
||||
noise = 0.000000001
|
||||
sel_feature = false
|
||||
```
|
||||
|
||||
The configuration items in the configuration file **/etc/atuned/engine.cnf** of the A-Tune engine are described as follows:
|
||||
|
||||
- Startup configuration of the A-Tune engine service (modify the parameter values as required).
|
||||
|
||||
- **engine_host**: Listening address of the A-Tune engine service. The default value is localhost.
|
||||
- **engine_port**: Listening port of the A-Tune engine service. The value ranges from 0 to 65535. The default value is 3838.
|
||||
- **engine_tls**: Indicates whether to enable SSL/TLS certificate verification for the A-Tune engine service. This function is enabled by default.
|
||||
- **tlsenginecacertfile**: Path of the server CA certificate of the A-Tune engine service.
|
||||
- **tlsengineservercertfile**: Path of the server certificate of the A-Tune engine service.
|
||||
- **tlsengineserverkeyfile**: Server key path of the A-Tune engine service.
|
||||
|
||||
- Log information
|
||||
|
||||
Change the log level as required. The default log level is info. Log information is recorded in the **/var/log/messages** file.
|
||||
|
||||
#### Example
|
||||
|
||||
```conf
|
||||
#################################### engine ###############################
|
||||
[server]
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = localhost
|
||||
engine_port = 3838
|
||||
|
||||
# enable engine server authentication SSL/TLS
|
||||
# default is true
|
||||
engine_tls = true
|
||||
tlsenginecacertfile = /etc/atuned/engine_certs/ca.crt
|
||||
tlsengineservercertfile = /etc/atuned/engine_certs/server.crt
|
||||
tlsengineserverkeyfile = /etc/atuned/engine_certs/server.key
|
||||
|
||||
#################################### log ###############################
|
||||
[log]
|
||||
# either "debug", "info", "warn", "error", "critical", default is "info"
|
||||
level = info
|
||||
```
|
||||
|
||||
## Starting A-Tune
|
||||
|
||||
After A-Tune is installed, you need to configure the A-Tune service before starting it.
|
||||
|
||||
- Configure the A-Tune service.
|
||||
Modify the network adapter and drive information in the **atuned.cnf** configuration file.
|
||||
> Note:
|
||||
>
|
||||
> If atuned is installed through `make install`, the network adapter and drive information in the configuration file is automatically updated to the default devices on the machine. To collect data from other devices, perform the following steps to configure atuned.
|
||||
|
||||
Run the following command to search for the network adapter that needs to be specified for optimization or data collection, and change the value of **network** in the **/etc/atuned/atuned.cnf** file to the specified network adapter:
|
||||
|
||||
```shell
|
||||
ip addr
|
||||
```
|
||||
|
||||
Run the following command to search for the drive that need to be specified for optimization or data collection, and change the value of **disk** in the **/etc/atuned/atuned.cnf** file to the specified drive:
|
||||
|
||||
```shell
|
||||
fdisk -l | grep dev
|
||||
```
|
||||
|
||||
- About the certificate:
|
||||
The A-Tune engine and client use the gRPC communication protocol. Therefore, you need to configure a certificate to ensure system security. For information security purposes, A-Tune does not provide a certificate generation method. You need to configure a system certificate by yourself.
|
||||
If security is not considered, set **rest_tls** and **engine_tls** in the **/etc/atuned/atuned.cnf** file to **false**, set **engine_tls** in the **/etc/atuned/engine.cnf** file to **false**.
|
||||
A-Tune is not liable for any consequences incurred if no security certificate is configured.
|
||||
|
||||
- Start the atuned service.
|
||||
|
||||
```shell
|
||||
systemctl start atuned
|
||||
```
|
||||
|
||||
- Query the atuned service status.
|
||||
|
||||
```shell
|
||||
systemctl status atuned
|
||||
```
|
||||
|
||||
If the following command output is displayed, the service is started successfully:
|
||||
|
||||

|
||||
|
||||
## Starting A-Tune Engine
|
||||
|
||||
To use AI functions, you need to start the A-Tune engine service.
|
||||
|
||||
- Start the atune-engine service.
|
||||
|
||||
```shell
|
||||
systemctl start atune-engine
|
||||
```
|
||||
|
||||
- Query the atune-engine service status.
|
||||
|
||||
```shell
|
||||
systemctl status atune-engine
|
||||
```
|
||||
|
||||
If the following command output is displayed, the service is started successfully:
|
||||
|
||||

|
||||
|
||||
## Distributed Deployment
|
||||
|
||||
### Purpose of Distributed Deployment
|
||||
|
||||
A-Tune supports distributed deployment to implement distributed architecture and on-demand deployment. The components of A-Tune can be deployed separately. Lightweight component deployment has little impact on services and avoids installing too many dependencies to reduce the system load.
|
||||
|
||||
This document describes only a common deployment mode: deploying the client and server on the same node and deploying the engine module on another node. For details about other deployment modes, contact A-Tune developers.
|
||||
|
||||
**Deployment relationship**
|
||||

|
||||
|
||||
### Configuration File
|
||||
|
||||
In distributed deployment mode, you need to configure the write the IP address and port number of the engine in the configuration file so that other components can access the engine component through the IP address.
|
||||
|
||||
1. Modify the **/etc/atuned/atuned.cnf** file on the server node.
|
||||
|
||||
- Change the values of **engine_host** and **engine_port** in line 34 to the IP address and port number of the engine node. For the deployment in the preceding figure, the values are **engine_host = 192.168.0.1 engine_port = 3838**.
|
||||
- Change the values of **rest_tls** and **engine_tls** in lines 49 and 55 to **false**. Otherwise, you need to apply for and configure certificates. You do not need to configure SSL certificates in the test environment. However, you need to configure SSL certificates in the production environment to prevent security risks.
|
||||
|
||||
2. Modify the**/etc/atuned/engine.cnf** file on the engine node.
|
||||
|
||||
- Change the values of **engine_host** and **engine_port** in lines 17 and 18 to the IP address and port number of the engine node. For the deployment in the preceding figure, the value are **engine_host = 192.168.0.1 engine_port = 3838**.
|
||||
- Change the value of **engine_tls** in line 22 to **false**.
|
||||
|
||||
3. After modifying the configuration file, restart the service for the modification to take effect.
|
||||
|
||||
- Run the `systemctl restart atuned command` on the server node.
|
||||
- Run the `systemctl restart atune-engine` command on the engine node.
|
||||
|
||||
4. (Optional) Run the `tuning` command in the **A-Tune/examples/tuning/compress** folder.
|
||||
|
||||
- For details, see **A-Tune/examples/tuning/compress/README**.
|
||||
- Run the `atune-adm tuning --project compress --detail compress_client.yaml` command.
|
||||
- This step is to check whether the distributed deployment is successful.
|
||||
|
||||
### Precautions
|
||||
|
||||
1. This document does not describe how to configure the authentication certificates. You can set **rest_tls** or **engine_tls** in the **atuned.cnf** and **engine.cnf** files to **false** if necessary.
|
||||
2. After modifying the configuration file, restart the service. Otherwise, the modification does not take effect.
|
||||
3. Do not enable the proxy when using A-Tune.
|
||||
4. The **disk** and **network** items of the **\[system]** section in the **atuned.cnf** file need to be modified. For details about how to modify the items, see the [A-Tune User Guide](https://gitee.com/gaoruoshu/A-Tune/blob/master/Documentation/UserGuide/A-Tune%E7%94%A8%E6%88%B7%E6%8C%87%E5%8D%97.md).
|
||||
|
||||
### Example
|
||||
|
||||
#### atuned.cnf
|
||||
|
||||
```conf
|
||||
# ......
|
||||
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = 192.168.0.1
|
||||
engine_port = 3838
|
||||
|
||||
# ......
|
||||
```
|
||||
|
||||
#### engine.cnf
|
||||
|
||||
```bash
|
||||
[server]
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = 192.168.0.1
|
||||
engine_port = 3838
|
||||
```
|
||||
|
||||
## Cluster Deployment
|
||||
|
||||
### Purpose of Cluster Deployment
|
||||
|
||||
To support fast tuning in multi-node scenarios, A-Tune supports dynamic tuning of parameter settings on multiple nodes at the same time. In this way, you do not need to tune each node separately, improving tuning efficiency.
|
||||
Cluster deployment mode consists of one master node and several agent nodes. The client and server are deployed on the master node to receive commands and interact with the engine. Other nodes receive instructions from the master node and configure the parameters of the current node.
|
||||
|
||||
**Deployment relationship**
|
||||

|
||||
|
||||
In the preceding figure, the client and server are deployed on the node whose IP address is 192.168.0.0. Project files are stored on this node. Other nodes do not contain project files.
|
||||
The master node communicates with the agent nodes through TCP. Therefore, you need to modify the configuration file.
|
||||
|
||||
### Modifications to atuned.cnf
|
||||
|
||||
1. Set the value of **protocol** to **tcp**.
|
||||
2. Set the value of **address** to the IP address of the current node.
|
||||
3. Set the value of **connect** to the IP addresses of all nodes. The first IP address is the IP address of the master node, and the subsequent IP addresses are the IP addresses of agent nodes. Use commas (,) to separate the IP addresses.
|
||||
4. During debugging, you can set **rest_tls** and **engine_tls** to **false**.
|
||||
5. Perform the same modification on the **atuned.cnf** files of all the master and agent nodes.
|
||||
|
||||
### Precautions
|
||||
|
||||
1. The values of **engine_host** and **engine_port** must be consistent in the **engine.cnf** file and the **atuned.cnf** file on the server.
|
||||
2. This document does not describe how to configure the authentication certificates. You can set **rest_tls** or **engine_tls** in the **atuned.cnf** and **engine.cnf** files to **false** if necessary.
|
||||
3. After modifying the configuration file, restart the service. Otherwise, the modification does not take effect.
|
||||
4. Do not enable the proxy when using A-Tune.
|
||||
|
||||
### Example
|
||||
|
||||
#### atuned.cnf
|
||||
|
||||
```conf
|
||||
# ......
|
||||
|
||||
[server]
|
||||
# the protocol grpc server running on
|
||||
# ranges: unix or tcp
|
||||
protocol = tcp
|
||||
|
||||
# the address that the grpc server to bind to
|
||||
# default is unix socket /var/run/atuned/atuned.sock
|
||||
# ranges: /var/run/atuned/atuned.sock or ip address
|
||||
address = 192.168.0.0
|
||||
|
||||
# the atune nodes in cluster mode, separated by commas
|
||||
# it is valid when protocol is tcp
|
||||
connect = 192.168.0.0,192.168.0.1,192.168.0.2,192.168.0.3
|
||||
|
||||
# the atuned grpc listening port
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
port = 60001
|
||||
|
||||
# the rest service listening port, default is 8383
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
rest_host = localhost
|
||||
rest_port = 8383
|
||||
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = 192.168.1.1
|
||||
engine_port = 3838
|
||||
|
||||
# ......
|
||||
```
|
||||
|
||||
#### engine.cnf
|
||||
|
||||
```bash
|
||||
[server]
|
||||
# the tuning optimizer host and port, start by engine.service
|
||||
# if engine_host is same as rest_host, two ports cannot be same
|
||||
# the port can be set between 0 to 65535 which not be used
|
||||
engine_host = 192.168.1.1
|
||||
engine_port = 3838
|
||||
```
|
||||
|
||||
Note: For details about the **engine.cnf** file, see the configuration file for distributed deployment.
|
||||
54
docs/en/24.03_LTS_SP2/native_turbo.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Native-Turbo
|
||||
|
||||
## Overview
|
||||
|
||||
The code segment and data segment of a large program can reach hundreds of MB, and the TLB miss rate of key service processes is high. The size of the kernel page table affects the performance.
|
||||
|
||||
To facilitate the use of huge pages, the Native-Turbo feature enables the system to automatically use huge pages when loading programs. Huge pages can be used for code segments and data segments.
|
||||
|
||||
## How to Use
|
||||
|
||||
1. Enable the feature.
|
||||
|
||||
This feature has two levels of switches. `sysctl fs.exec-use-hugetlb` determines whether to enable this feature in the system. (This command can only be run by the **root** user. The value `0` indicates that this feature is disabled, and the value `1` indicates that this feature is enabled. Other values are invalid.)
|
||||
|
||||
If not enabled, this feature will not be used even if users set environment variables because the kernel will ignore related processes.
|
||||
|
||||
After this feature is enabled, common users can use the environment variable `HUGEPAGE_PROBE` to determine whether to use huge pages for running programs. If the value is `1`, huge pages are used. If the value is not set, huge pages are not used.
|
||||
|
||||
```shell
|
||||
sysctl fs.exec-use-hugetlb=1 # The main program uses huge pages.
|
||||
export HUGEPAGE_PROBE=1 # The dynamic library uses huge pages.
|
||||
```
|
||||
|
||||
You can also configure the environment variable `LD_HUGEPAGE_LIB=1` to force all segments to use huge pages.
|
||||
|
||||
2. Mark the segments that need to use huge pages. By default, all segments are marked. `-x` only marks code segments. `-d` clears existing marks.
|
||||
|
||||
```shell
|
||||
hugepageedit [-x] [-d] app
|
||||
```
|
||||
|
||||
This tool is provided by the glibc-devel package.
|
||||
|
||||
3. Run the application.
|
||||
|
||||
./app
|
||||
|
||||
## Restrictions
|
||||
|
||||
1. The program and dynamic library must be compiled in 2 MB alignment mode by adding the following GCC compilation parameters:
|
||||
|
||||
```shell
|
||||
-zcommon-page-size=0x200000 -zmax-page-size=0x200000
|
||||
```
|
||||
|
||||
2. Sufficient huge pages must be reserved before use. Otherwise, the program will fail to be executed.
|
||||
|
||||
If the cgroup is used, pay attention to the `hugetlb` limit. If the limit is less than the number of required huge pages, the system may break down during running.
|
||||
|
||||
3. The size of the process page table is changed to 2 MB. Therefore, the parameters invoked by the system such as `mprotect` must be aligned by 2 MB. Otherwise, the execution will fail.
|
||||
|
||||
4. The LibcarePlus hot patch mechanism is not supported.
|
||||
|
||||
5. Huge pages cannot be shared among multiple processes because they will consume multiple times of memory.
|
||||
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-caution.gif
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-danger.gif
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-note.gif
Normal file
|
After Width: | Height: | Size: 394 B |
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-notice.gif
Normal file
|
After Width: | Height: | Size: 406 B |
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-tip.gif
Normal file
|
After Width: | Height: | Size: 253 B |
BIN
docs/en/24.03_LTS_SP2/public_sys-resources/icon-warning.gif
Normal file
|
After Width: | Height: | Size: 580 B |
731
docs/en/24.03_LTS_SP2/usage_instructions.md
Normal file
@@ -0,0 +1,731 @@
|
||||
# Usage Instructions
|
||||
|
||||
You can use functions provided by A-Tune through the CLI client atune-adm. This chapter describes the functions and usage of the A-Tune client.
|
||||
|
||||
## Overview
|
||||
|
||||
- You can run the **atune-adm help/--help/-h** command to query commands supported by atune-adm.
|
||||
- The **define**, **update**, **undefine**, **collection**, **train**, and **upgrade**commands do not support remote execution.
|
||||
- In the command format, brackets \(\[\]\) indicate that the parameter is optional, and angle brackets \(<\>\) indicate that the parameter is mandatory. The actual parameters prevail.
|
||||
|
||||
## Querying Workload Types
|
||||
|
||||
### list
|
||||
|
||||
#### Function
|
||||
|
||||
Query the supported profiles, and the values of Active.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm list**
|
||||
|
||||
#### Example
|
||||
|
||||
```shell
|
||||
# atune-adm list
|
||||
|
||||
Support profiles:
|
||||
+------------------------------------------------+-----------+
|
||||
| ProfileName | Active |
|
||||
+================================================+===========+
|
||||
| arm-native-android-container-robox | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-euleros-baseline-fio | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-euleros-baseline-lmbench | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-euleros-baseline-netperf | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-euleros-baseline-stream | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-euleros-baseline-unixbench | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-speccpu-speccpu2006 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| basic-test-suite-specjbb-specjbb2015 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-hdfs-dfsio-hdd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-hdfs-dfsio-ssd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-bayesian | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-kmeans | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql1 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql10 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql2 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql4 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql5 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql6 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql7 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql8 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-sql9 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-tersort | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| big-data-hadoop-spark-wordcount | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| cloud-compute-kvm-host | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-mariadb-2p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-mariadb-4p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-mongodb-2p-sysbench | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-mysql-2p-sysbench-hdd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-mysql-2p-sysbench-ssd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-postgresql-2p-sysbench-hdd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| database-postgresql-2p-sysbench-ssd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| default-default | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| docker-mariadb-2p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| docker-mariadb-4p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| hpc-gatk4-human-genome | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| in-memory-database-redis-redis-benchmark | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| middleware-dubbo-dubbo-benchmark | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| storage-ceph-vdbench-hdd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| storage-ceph-vdbench-ssd | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| virtualization-consumer-cloud-olc | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| virtualization-mariadb-2p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| virtualization-mariadb-4p-tpcc-c3 | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| web-apache-traffic-server-spirent-pingpo | false |
|
||||
+------------------------------------------------+-----------+
|
||||
| web-nginx-http-long-connection | true |
|
||||
+------------------------------------------------+-----------+
|
||||
| web-nginx-https-short-connection | false |
|
||||
+------------------------------------------------+-----------+
|
||||
```
|
||||
|
||||
> [!NOTE]NOTE
|
||||
> If the value of Active is **true**, the profile is activated. In the example, the profile of web-nginx-http-long-connection is activated.
|
||||
|
||||
## Workload Type Analysis and Auto Optimization
|
||||
|
||||
### analysis
|
||||
|
||||
#### Function
|
||||
|
||||
Collect real-time statistics from the system to identify and automatically optimize workload types.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm analysis** \[OPTIONS\]
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
- OPTIONS
|
||||
|
||||
| Parameter | Description |
|
||||
| ------------------------ | ---------------------------------------------------------------------------------------------- |
|
||||
| --model, -m | New model generated after user self-training |
|
||||
| --characterization, -c | Use the default model for application identification and do not perform automatic optimization |
|
||||
| --times value, -t value | Time duration for data collection |
|
||||
| --script value, -s value | File to be executed |
|
||||
|
||||
#### Example
|
||||
|
||||
- Use the default model for application identification.
|
||||
|
||||
```shell
|
||||
# atune-adm analysis --characterization
|
||||
```
|
||||
|
||||
- Use the default model to identify applications and perform automatic tuning.
|
||||
|
||||
```shell
|
||||
# atune-adm analysis
|
||||
```
|
||||
|
||||
- Use the user-defined training model for recognition.
|
||||
|
||||
```shell
|
||||
# atune-adm analysis --model /usr/libexec/atuned/analysis/models/new-model.m
|
||||
```
|
||||
|
||||
## User-defined Model
|
||||
|
||||
A-Tune allows users to define and learn new models. To define a new model, perform the following steps:
|
||||
|
||||
1. Run the **define** command to define a new profile.
|
||||
2. Run the **collection** command to collect the system data corresponding to the application.
|
||||
3. Run the **train** command to train the model.
|
||||
|
||||
### define
|
||||
|
||||
#### Function
|
||||
|
||||
Add a user-defined application scenarios and the corresponding profile tuning items.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm define** \<service_type> \<application_name> \<scenario_name> \<profile_path>
|
||||
|
||||
#### Example
|
||||
|
||||
Add a profile whose service_type is **test_service**, application_name is **test_app**, scenario_name is **test_scenario**, and tuning item configuration file is **example.conf**.
|
||||
|
||||
```shell
|
||||
# atune-adm define test_service test_app test_scenario ./example.conf
|
||||
```
|
||||
|
||||
The **example.conf** file can be written as follows (the following optimization items are optional and are for reference only). You can also run the **atune-adm info** command to view how the existing profile is written.
|
||||
|
||||
```ini
|
||||
[main]
|
||||
# list its parent profile
|
||||
[kernel_config]
|
||||
# to change the kernel config
|
||||
[bios]
|
||||
# to change the bios config
|
||||
[bootloader.grub2]
|
||||
# to change the grub2 config
|
||||
[sysfs]
|
||||
# to change the /sys/* config
|
||||
[systemctl]
|
||||
# to change the system service status
|
||||
[sysctl]
|
||||
# to change the /proc/sys/* config
|
||||
[script]
|
||||
# the script extension of cpi
|
||||
[ulimit]
|
||||
# to change the resources limit of user
|
||||
[schedule_policy]
|
||||
# to change the schedule policy
|
||||
[check]
|
||||
# check the environment
|
||||
[tip]
|
||||
# the recommended optimization, which should be performed manunaly
|
||||
```
|
||||
|
||||
### collection
|
||||
|
||||
#### Function
|
||||
|
||||
Collect the global resource usage and OS status information during service running, and save the collected information to a CSV output file as the input dataset for model training.
|
||||
|
||||
> [!NOTE]NOTE
|
||||
>
|
||||
> - This command depends on the sampling tools such as perf, mpstat, vmstat, iostat, and sar.
|
||||
> - Currently, only the Kunpeng 920 CPU is supported. You can run the **dmidecode -t processor** command to check the CPU model.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm collection** <OPTIONS\>
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
- OPTIONS
|
||||
|
||||
| Parameter | Description |
|
||||
| ----------------- | ----------------------------------------------------------------------------------------------------- |
|
||||
| --filename, -f | Name of the generated CSV file used for training: *name*-*timestamp*.csv |
|
||||
| --output_path, -o | Path for storing the generated CSV file. The absolute path is required. |
|
||||
| --disk, -b | Disk used during service running, for example, /dev/sda. |
|
||||
| --network, -n | Network port used during service running, for example, eth0. |
|
||||
| --app_type, -t | Mark the application type of the service as a label for training. |
|
||||
| --duration, -d | Data collection time during service running, in seconds. The default collection time is 1200 seconds. |
|
||||
| --interval, -i | Interval for collecting data, in seconds. The default interval is 5 seconds. |
|
||||
|
||||
#### Example
|
||||
|
||||
```shell
|
||||
# atune-adm collection --filename name --interval 5 --duration 1200 --output_path /home/data --disk sda --network eth0 --app_type test_service-test_app-test_scenario
|
||||
```
|
||||
|
||||
> Note:
|
||||
>
|
||||
> In the example, data is collected every 5 seconds for a duration of 1200 seconds. The collected data is stored as the *name* file in the **/home/data** directory. The application type of the service is defined by the `atune-adm define` command, which is **test_service-test_app-test_scenario** in this example.
|
||||
> The data collection interval and duration can be specified using the preceding command options.
|
||||
|
||||
### train
|
||||
|
||||
#### Function
|
||||
|
||||
Use the collected data to train the model. Collect data of at least two application types during training. Otherwise, an error is reported.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm train** <OPTIONS\>
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
- OPTIONS
|
||||
|
||||
| Parameter | Description |
|
||||
| ----------------- | ------------------------------------------------------ |
|
||||
| --data_path, -d | Path for storing CSV files required for model training |
|
||||
| --output_file, -o | Model generated through training |
|
||||
|
||||
#### Example
|
||||
|
||||
Use the CSV file in the **data** directory as the training input. The generated model **new-model.m** is stored in the **model** directory.
|
||||
|
||||
```shell
|
||||
# atune-adm train --data_path /home/data --output_file /usr/libexec/atuned/analysis/models/new-model.m
|
||||
```
|
||||
|
||||
### undefine
|
||||
|
||||
#### Function
|
||||
|
||||
Delete a user-defined profile.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm undefine** <profile\>
|
||||
|
||||
#### Example
|
||||
|
||||
Delete the user-defined profile.
|
||||
|
||||
```shell
|
||||
# atune-adm undefine test_service-test_app-test_scenario
|
||||
```
|
||||
|
||||
## Querying Profiles
|
||||
|
||||
### info
|
||||
|
||||
#### Function
|
||||
|
||||
View the profile content.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm info** <profile\>
|
||||
|
||||
#### Example
|
||||
|
||||
View the profile content of web-nginx-http-long-connection.
|
||||
|
||||
```shell
|
||||
# atune-adm info web-nginx-http-long-connection
|
||||
|
||||
*** web-nginx-http-long-connection:
|
||||
|
||||
#
|
||||
# nginx http long connection A-Tune configuration
|
||||
#
|
||||
[main]
|
||||
include = default-default
|
||||
|
||||
[kernel_config]
|
||||
#TODO CONFIG
|
||||
|
||||
[bios]
|
||||
#TODO CONFIG
|
||||
|
||||
[bootloader.grub2]
|
||||
iommu.passthrough = 1
|
||||
|
||||
[sysfs]
|
||||
#TODO CONFIG
|
||||
|
||||
[systemctl]
|
||||
sysmonitor = stop
|
||||
irqbalance = stop
|
||||
|
||||
[sysctl]
|
||||
fs.file-max = 6553600
|
||||
fs.suid_dumpable = 1
|
||||
fs.aio-max-nr = 1048576
|
||||
kernel.shmmax = 68719476736
|
||||
kernel.shmall = 4294967296
|
||||
kernel.shmmni = 4096
|
||||
kernel.sem = 250 32000 100 128
|
||||
net.ipv4.tcp_tw_reuse = 1
|
||||
net.ipv4.tcp_syncookies = 1
|
||||
net.ipv4.ip_local_port_range = 1024 65500
|
||||
net.ipv4.tcp_max_tw_buckets = 5000
|
||||
net.core.somaxconn = 65535
|
||||
net.core.netdev_max_backlog = 262144
|
||||
net.ipv4.tcp_max_orphans = 262144
|
||||
net.ipv4.tcp_max_syn_backlog = 262144
|
||||
net.ipv4.tcp_timestamps = 0
|
||||
net.ipv4.tcp_synack_retries = 1
|
||||
net.ipv4.tcp_syn_retries = 1
|
||||
net.ipv4.tcp_fin_timeout = 1
|
||||
net.ipv4.tcp_keepalive_time = 60
|
||||
net.ipv4.tcp_mem = 362619 483495 725238
|
||||
net.ipv4.tcp_rmem = 4096 87380 6291456
|
||||
net.ipv4.tcp_wmem = 4096 16384 4194304
|
||||
net.core.wmem_default = 8388608
|
||||
net.core.rmem_default = 8388608
|
||||
net.core.rmem_max = 16777216
|
||||
net.core.wmem_max = 16777216
|
||||
|
||||
[script]
|
||||
prefetch = off
|
||||
ethtool = -X {network} hfunc toeplitz
|
||||
|
||||
[ulimit]
|
||||
{user}.hard.nofile = 102400
|
||||
{user}.soft.nofile = 102400
|
||||
|
||||
[schedule_policy]
|
||||
#TODO CONFIG
|
||||
|
||||
[check]
|
||||
#TODO CONFIG
|
||||
|
||||
[tip]
|
||||
SELinux provides extra control and security features to linux kernel. Disabling SELinux will improve the performance but may cause security risks. = kernel
|
||||
disable the nginx log = application
|
||||
```
|
||||
|
||||
## Updating a Profile
|
||||
|
||||
You can update the existing profile as required.
|
||||
|
||||
### update
|
||||
|
||||
#### Function
|
||||
|
||||
Update the original tuning items in the existing profile to the content in the **new.conf** file.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm update** <profile\> <profile_path\>
|
||||
|
||||
#### Example
|
||||
|
||||
Change the tuning item of the profile named **test_service-test_app-test_scenario** to **new.conf**.
|
||||
|
||||
```shell
|
||||
# atune-adm update test_service-test_app-test_scenario ./new.conf
|
||||
```
|
||||
|
||||
## Activating a Profile
|
||||
|
||||
### profile
|
||||
|
||||
#### Function
|
||||
|
||||
Manually activate the profile to make it in the active state.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm profile** <profile\>
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
For details about the profile name, see the query result of the list command.
|
||||
|
||||
#### Example
|
||||
|
||||
Activate the profile corresponding to the web-nginx-http-long-connection.
|
||||
|
||||
```shell
|
||||
# atune-adm profile web-nginx-http-long-connection
|
||||
```
|
||||
|
||||
## Rolling Back Profiles
|
||||
|
||||
### rollback
|
||||
|
||||
#### Functions
|
||||
|
||||
Roll back the current configuration to the initial configuration of the system.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm rollback**
|
||||
|
||||
#### Example
|
||||
|
||||
```shell
|
||||
# atune-adm rollback
|
||||
```
|
||||
|
||||
## Updating Database
|
||||
|
||||
### upgrade
|
||||
|
||||
#### Function
|
||||
|
||||
Update the system database.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm upgrade** <DB\_FILE\>
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
- DB\_FILE
|
||||
|
||||
New database file path.
|
||||
|
||||
#### Example
|
||||
|
||||
The database is updated to **new\_sqlite.db**.
|
||||
|
||||
```shell
|
||||
# atune-adm upgrade ./new_sqlite.db
|
||||
```
|
||||
|
||||
## Querying System Information
|
||||
|
||||
### check
|
||||
|
||||
#### Function
|
||||
|
||||
Check the CPU, BIOS, OS, and NIC information.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm check**
|
||||
|
||||
#### Example
|
||||
|
||||
```shell
|
||||
# atune-adm check
|
||||
cpu information:
|
||||
cpu:0 version: Kunpeng 920-6426 speed: 2600000000 HZ cores: 64
|
||||
cpu:1 version: Kunpeng 920-6426 speed: 2600000000 HZ cores: 64
|
||||
system information:
|
||||
DMIBIOSVersion: 0.59
|
||||
OSRelease: 4.19.36-vhulk1906.3.0.h356.eulerosv2r8.aarch64
|
||||
network information:
|
||||
name: eth0 product: HNS GE/10GE/25GE RDMA Network Controller
|
||||
name: eth1 product: HNS GE/10GE/25GE Network Controller
|
||||
name: eth2 product: HNS GE/10GE/25GE RDMA Network Controller
|
||||
name: eth3 product: HNS GE/10GE/25GE Network Controller
|
||||
name: eth4 product: HNS GE/10GE/25GE RDMA Network Controller
|
||||
name: eth5 product: HNS GE/10GE/25GE Network Controller
|
||||
name: eth6 product: HNS GE/10GE/25GE RDMA Network Controller
|
||||
name: eth7 product: HNS GE/10GE/25GE Network Controller
|
||||
name: docker0 product:
|
||||
```
|
||||
|
||||
## Automatic Parameter Optimization
|
||||
|
||||
A-Tune provides the automatic search capability with the optimal configuration, saving the trouble of manually configuring parameters and performance evaluation. This greatly improves the search efficiency of optimal configurations.
|
||||
|
||||
### Tuning
|
||||
|
||||
#### Function
|
||||
|
||||
Use the specified project file to search the dynamic space for parameters and find the optimal solution under the current environment configuration.
|
||||
|
||||
#### Format
|
||||
|
||||
**atune-adm tuning** \[OPTIONS\] <PROJECT\_YAML\>
|
||||
|
||||
> [!NOTE]NOTE
|
||||
Before running the command, ensure that the following conditions are met:
|
||||
|
||||
1. The YAML configuration file on the server has been edited and stored in the **/etc/atuned/tuning/** directory of the atuned service.
|
||||
2. The YAML configuration file of the client has been edited and stored on the atuned client.
|
||||
|
||||
#### Parameter Description
|
||||
|
||||
- OPTIONS
|
||||
|
||||
| Parameter | Description |
|
||||
| ------------- | ----------------------------------------------------------- |
|
||||
| --restore, -r | Restores the initial configuration before tuning. |
|
||||
| --project, -p | Specifies the project name in the YAML file to be restored. |
|
||||
| --restart, -c | Perform tuning based on historical tuning results. |
|
||||
| --detail, -d | Print detailed information about the tuning process. |
|
||||
|
||||
> [!NOTE]NOTE
|
||||
> If this parameter is used, the -p parameter must be followed by a specific project name and the YAML file of the project must be specified.
|
||||
|
||||
- **PROJECT\_YAML**: YAML configuration file of the client.
|
||||
|
||||
#### Configuration Description
|
||||
|
||||
**Table 1** YAML file on the server
|
||||
|
||||
| Name | Description | Type | Value Range |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------- |
|
||||
| project | Project name. | Character string | - |
|
||||
| startworkload | Script for starting the service to be optimized. | Character string | - |
|
||||
| stopworkload | Script for stopping the service to be optimized. | Character string | - |
|
||||
| maxiterations | Maximum number of optimization iterations, which is used to limit the number of iterations on the client. Generally, the more optimization iterations, the better the optimization effect, but the longer the time required. Set this parameter based on the site requirements. | Integer | >10 |
|
||||
| object | Parameters to be optimized and related information. <br> For details about the object configuration items, see Table 2. | | |
|
||||
|
||||
**Table 2** Description of object configuration items
|
||||
|
||||
| Name | Description | Type | Value Range |
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------- |
|
||||
| name | Parameter to be optimized. | Character string | - |
|
||||
| desc | Description of parameters to be optimized. | Character string | - |
|
||||
| get | Script for querying parameter values. | - | - |
|
||||
| set | Script for setting parameter values. | - | - |
|
||||
| needrestart | Specifies whether to restart the service for the parameter to take effect. | Enumeration | **true** or **false** |
|
||||
| type | Parameter type. Currently, the **discrete** and **continuous** types are supported. | Enumeration | **discrete** or **continuous** |
|
||||
| dtype | This parameter is available only when type is set to **discrete**. Currently, **int**, **float** and **string** are supported. | Enumeration | int, float, string |
|
||||
| scope | Parameter setting range. This parameter is valid only when type is set to discrete and **dtype** is set to **int** or **float**, or **type** is set to **continuous**. | Integer/Float | The value is user-defined and must be within the valid range of this parameter. |
|
||||
| step | Parameter value step, which is used when **dtype** is set to **int** or **float**. | Integer/Float | This value is user-defined. |
|
||||
| items | Enumerated value of which the parameter value is not within the scope. This is used when **dtype** is set to **int** or **float**. | Integer/Float | The value is user-defined and must be within the valid range of this parameter. |
|
||||
| options | Enumerated value range of the parameter value, which is used when **dtype** is set to **string**. | Character string | The value is user-defined and must be within the valid range of this parameter. |
|
||||
|
||||
**Table 3** Description of configuration items of a YAML file on the client
|
||||
|
||||
| Name | Description | Type | Value Range |
|
||||
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ------------------------------------------------- |
|
||||
| project | Project name, which must be the same as that in the configuration file on the server. | Character string | - |
|
||||
| engine | Tuning algorithm. | Character string | "random", "forest", "gbrt", "bayes", "extraTrees" |
|
||||
| iterations | Number of optimization iterations. | Integer | ≥ 10 |
|
||||
| random_starts | Number of random iterations. | Integer | \< iterations |
|
||||
| feature_filter_engine | Parameter search algorithm, which is used to select important parameters. This parameter is optional. | Character string | "lhs" |
|
||||
| feature_filter_cycle | Parameter search cycles, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - |
|
||||
| feature_filter_iters | Number of iterations for each cycle of parameter search, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - |
|
||||
| split_count | Number of evenly selected parameters in the value range of tuning parameters, which is used to select important parameters. This parameter is used together with feature_filter_engine. | Integer | - |
|
||||
| benchmark | Performance test script. | - | - |
|
||||
| evaluations | Performance test evaluation index.<br>For details about the evaluations configuration items, see Table 4. | - | - |
|
||||
|
||||
**Table 4** Description of evaluations configuration item
|
||||
|
||||
| Name | Description | Type | Value Range |
|
||||
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ---------------------------- |
|
||||
| name | Evaluation index name. | Character string | - |
|
||||
| get | Script for obtaining performance evaluation results. | - | - |
|
||||
| type | Specifies a **positive** or **negative** type of the evaluation result. The value **positive** indicates that the performance value is minimized, and the value **negative** indicates that the performance value is maximized. | Enumeration | **positive** or **negative** |
|
||||
| weight | Weight of the index. The value ranges from 0 to 100. | Integer | 0-100 |
|
||||
| threshold | Minimum performance requirement of the index. | Integer | User-defined |
|
||||
|
||||
#### Example
|
||||
|
||||
The following is an example of the YAML file configuration on a server:
|
||||
|
||||
```yaml
|
||||
project: "compress"
|
||||
maxiterations: 500
|
||||
startworkload: ""
|
||||
stopworkload: ""
|
||||
object :
|
||||
-
|
||||
name : "compressLevel"
|
||||
info :
|
||||
desc : "The compresslevel parameter is an integer from 1 to 9 controlling the level of compression"
|
||||
get : "cat /root/A-Tune/examples/tuning/compress/compress.py | grep 'compressLevel=' | awk -F '=' '{print $2}'"
|
||||
set : "sed -i 's/compressLevel=\\s*[0-9]*/compressLevel=$value/g' /root/A-Tune/examples/tuning/compress/compress.py"
|
||||
needrestart : "false"
|
||||
type : "continuous"
|
||||
scope :
|
||||
- 1
|
||||
- 9
|
||||
dtype : "int"
|
||||
-
|
||||
name : "compressMethod"
|
||||
info :
|
||||
desc : "The compressMethod parameter is a string controlling the compression method"
|
||||
get : "cat /root/A-Tune/examples/tuning/compress/compress.py | grep 'compressMethod=' | awk -F '=' '{print $2}' | sed 's/\"//g'"
|
||||
set : "sed -i 's/compressMethod=\\s*[0-9,a-z,\"]*/compressMethod=\"$value\"/g' /root/A-Tune/examples/tuning/compress/compress.py"
|
||||
needrestart : "false"
|
||||
type : "discrete"
|
||||
options :
|
||||
- "bz2"
|
||||
- "zlib"
|
||||
- "gzip"
|
||||
dtype : "string"
|
||||
```
|
||||
|
||||
The following is an example of the YAML file configuration on a client:
|
||||
|
||||
```yaml
|
||||
project: "compress"
|
||||
engine : "gbrt"
|
||||
iterations : 20
|
||||
random_starts : 10
|
||||
|
||||
benchmark : "python3 /root/A-Tune/examples/tuning/compress/compress.py"
|
||||
evaluations :
|
||||
-
|
||||
name: "time"
|
||||
info:
|
||||
get: "echo '$out' | grep 'time' | awk '{print $3}'"
|
||||
type: "positive"
|
||||
weight: 20
|
||||
-
|
||||
name: "compress_ratio"
|
||||
info:
|
||||
get: "echo '$out' | grep 'compress_ratio' | awk '{print $3}'"
|
||||
type: "negative"
|
||||
weight: 80
|
||||
```
|
||||
|
||||
#### Example
|
||||
|
||||
- Download test data.
|
||||
|
||||
```shell
|
||||
wget http://cs.fit.edu/~mmahoney/compression/enwik8.zip
|
||||
```
|
||||
|
||||
- Prepare the tuning environment.
|
||||
|
||||
Example of **prepare.sh**:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/bash
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "USAGE: $0 the path of enwik8.zip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
path=$(
|
||||
cd "$(dirname "$0")"
|
||||
pwd
|
||||
)
|
||||
|
||||
echo "unzip enwik8.zip"
|
||||
unzip "$path"/enwik8.zip
|
||||
|
||||
echo "set FILE_PATH to the path of enwik8 in compress.py"
|
||||
sed -i "s#compress/enwik8#$path/enwik8#g" "$path"/compress.py
|
||||
|
||||
echo "update the client and server yaml files"
|
||||
sed -i "s#python3 .*compress.py#python3 $path/compress.py#g" "$path"/compress_client.yaml
|
||||
sed -i "s# compress/compress.py# $path/compress.py#g" "$path"/compress_server.yaml
|
||||
|
||||
echo "copy the server yaml file to /etc/atuned/tuning/"
|
||||
cp "$path"/compress_server.yaml /etc/atuned/tuning/
|
||||
```
|
||||
|
||||
Run the script.
|
||||
|
||||
```shell
|
||||
sh prepare.sh enwik8.zip
|
||||
```
|
||||
|
||||
- Run the `tuning` command to tune the parameters.
|
||||
|
||||
```shell
|
||||
atune-adm tuning --project compress --detail compress_client.yaml
|
||||
```
|
||||
|
||||
- Restore the configuration before running `tuning`. **compress** indicates the project name in the YAML file.
|
||||
|
||||
```shell
|
||||
atune-adm tuning --restore --project compress
|
||||
```
|
||||