Dynamic Acceleration
Preparations
Before dynamic acceleration, you need to perform two checks. Applications can be dynamically accelerated only when both conditions are met.
- Run the following command to check whether the binary file to be optimized can be located again:
readelf -a application | grep .rela.text
- If the binary file contains .rela.text, the file can be located again. In this case, the application can be optimized.
- If the binary file does not contain .rela.text, to allow BOLT to re-arrange functions (in addition to re-arranging code within functions) in your program, you need to add --emit-relocs or -q to the final link step of your application.
- If the binary file contains .rela.text, the file can be located again. In this case, the application can be optimized.
- Run the hce-wae --check command to check whether an application supports dynamic acceleration.
If 3 is displayed, dynamic acceleration is supported.
Procedure
In the following operations, the mysqld application in the /data/apps/mysql-8.0.28/bin directory is used as an example.
- Generate an instrumentation application and run it.
- Run the /data/hce-wae/dbo/gen_instrumentation /data/apps/mysql-8.0.28/bin/mysqld command to generate an instrumentation application.
Command format: /data/hce-wae/dbo/gen_instrumentationApplication path
The mysqld.inst instrumentation file is generated in the current directory.
- Run the instrumentation file to obtain the PID of the application process. In this example, the PID is 87042.
- Run the /data/hce-wae/dbo/gen_instrumentation /data/apps/mysql-8.0.28/bin/mysqld command to generate an instrumentation application.
- Create a dynamic acceleration configuration file for mysqld.
Each application to be optimized must have a configuration file. Workload Accelerator dynamically accelerates the application based on the configuration file.
- Run the following command to copy the default configuration file /data/hce-wae/config/mysqld.conf:
[root@localhost]# cp /data/hce-wae/config/hce-wae-tmp.conf /data/hce-wae/config/mysqld.conf
- Set the origin-exe field in the /data/hce-wae/config/mysqld.conf configuration file.
origin-exe indicates the location of the application to be optimized. In this example, the location is /data/apps/mysql-8.0.28/bin/mysqld.
[root@localhost]# vim /data/hce-wae/config/mysqld.conf
- Run the following command to copy the default configuration file /data/hce-wae/config/mysqld.conf:
- Use the configuration file and the PID to configure dynamic acceleration.
Command format: hce-wae --conf [PID] [/path/to/config]
- Enable dynamic acceleration to optimize the instrumentation application.
Command format: hce-wae --start [PID]
You can view the optimization status from the --status parameter. If the status is Running, the process is being optimized. If the status is Finished, the process has been optimized.
Command format: hce-wae --status [PID]
- Use the --snapshot parameter to generate an optimized .dbo binary snapshot file. In this example, the file is mysqld.dbo.
The default snapshot path is /data/hce-wae/snapshot/. You can change the path in the configuration file as needed. You can use this snapshot file to run the application without repeated optimization.
- Terminate dynamic acceleration to stop application optimization.
Command format: hce-wae --stop [PID]
CLI for Dynamic Acceleration
A CLI is provided for dynamic acceleration. Table 1 lists the supported commands.
Command |
How to Use |
Description |
---|---|---|
list |
list |
Obtains the process information in the current environment, including the PID, PPID, and command information. |
status |
status <PID> |
Queries ongoing dynamic acceleration tasks and their status. The following information is returned:
|
check |
check <PID> |
Checks whether the current process supports static or dynamic acceleration and displays the text result. |
show |
show <PID> |
Queries the process dependencies. |
conf |
conf <PID> |
Configures the dynamic acceleration capability for the target process. After you run the command, configuration options are displayed in sequence. Configure the options as prompted. |
start |
start <PID> |
Enables dynamic acceleration. |
stop |
stop <PID> |
Stops dynamic acceleration. |
snapshot |
snapshot <PID> |
Generates a dynamic acceleration snapshot. |
quit |
quit |
Exits the CLI. |
h/help |
h/help |
Shows help information. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot