Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Static Acceleration

Updated on 2024-08-28 GMT+08:00

Preparations

  1. 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.
  2. Collect the logs when the application is running.

    After deploying and preheating the application, you can run llvm-bolt -instrument -o -instrumentation-file to configure the way how the logs are collected.

    For example, to collect logs every 30 seconds after the test.so file is executed, run the following command to save the logs to the test.log file:

    llvm-bolt tests.so -instrument -o testd.so -instrumentation-file=test.log -instrumentation-sleep-time=30 -instrumentation-no-counters-clear

    • instrument -o: indicates the new dynamic library file generated after the log collection way is configured. In this example, the newly generated dynamic library is testd.so.
    • instrumentation-file: indicates the name of the file where the logs are saved. In this example, the log file is test.log.
    • instrumentation-sleep-time: indicates the interval for collecting logs, in seconds. In this example, logs are collected every 30 seconds.
    • instrumentation-no-counters-clear: indicates that the log counter information is not cleared after each log collection to ensure that the log context is continuous.
  3. Run the application corresponding to testd.so. The run logs of the application are automatically saved in the test.log file.

    Workload Accelerator will optimize the application based on the dynamic data in the test.log file.

Procedure

  • Use the native BOLT tool to optimize the application.

    Once you have test.log ready, you can use it for optimizations with BOLT. For example, you can run the following command:

    llvm-bolt <executable> -o <executable>.bolt -data=test.log -reorder-blocks=ext-tsp -reorder-functions=hfsort -split-functions -split-all-cold -split-eh -dyno-stats

    NOTE:

    The parameters in the command are for illustration purposes and are not the optimal combination of parameters.

  • Run the hce-wae-auto command to optimize the application.

    The hce-wae-auto command optimizes the application based on user-defined configuration file.

    The command format is hce-wae-auto [-h] [-c <Path>] [-s <Keyword>] [-e <Pattern>] [-l] [--free] Application.

    NOTE:
    • After you run the hce-wae-auto command, the path of the generated parameter set is the same as the binary output path (/data/hce-wae-auto/hce-wae-auto.data) in the configuration file by default.
    • After you run the hce-wae-auto command, a log file is automatically generated, and its default path is /var/log/hce-wae-auto/hce-wae-auto.log.
    Table 1 Parameter description

    Parameter

    Value Required

    Value Type

    Mandatory

    Description

    -h

    No

    /

    No

    Displays command parameter help information.

    -c

    Yes

    String

    No

    Defines the configuration file path. The default path is /etc/hce-wae-auto.conf.

    -s

    Yes

    String

    No

    Defines the keyword for fuzzy search of the last parameter set.

    If there is no saved parameter set, this parameter will not take effect.

    -e

    Yes

    String

    No

    Executes the selected parameter combination based on the content of the last parameter set. A sequence number must be specified.

    • A single number specifies the parameter combination corresponding to the sequence number.
    • The colon (:) indicates the sequence number range. For example, 4:6 indicates the sequence number range from 4 to 6. :7 indicates the sequence number range is from 1 to 7. 5: indicates the sequence number range is from 5 to the last. : indicates all the sequence numbers.
    • A single number can be used together with a sequence number range (:) and separated using a comma (,). For example, 1,4:6 indicates sequence numbers 1, 4, 5, and 6.

    -l

    No

    /

    No

    Generates and prints the parameter set based on the configuration file. The command is not automatically executed and the parameter set is not saved.

    --free

    No

    /

    No

    Indicates that the validity of parameters in the configuration file is not verified.

    Workload Accelerator performs simple verification on the parameters in the configuration file to determine whether the parameters are used for optimization using BOLT. If you run the --free command, the verification is canceled and parameters that are not for optimization can be entered.

    application

    No

    /

    Yes

    Specifies the binary file to be executed. You can add a relative path or an absolute path, for example, mysqld, /usr/bin/mysqld, or /bin/mysqld.

    NOTE:

    If the -c, -s, -e and -l parameters conflict, -s has the highest priority, followed by -l and then -e, and -c has the lowest priority.

    The following table describes some example commands.

    Example Command

    Description

    hce-wae-auto mysqld

    Reads the configuration from the default path, generates a parameter set based on configuration parameters, automatically executes the command, and saves the parameter set after the command is executed.

    hce-wae-auto mysqld -c /etc/my.conf -l

    Reads configuration parameters from the /etc/my.conf path, generates a parameter set, prints the generated command, but does not execute the command or save the parameter set.

    hce-wae-auto mysqld -c /etc/my.conf

    Reads configuration parameters from the /etc/my.conf path, generates a parameter set, automatically executes the command, and saves the parameter set after the command is executed.

    hce-wae-auto mysqld -s align

    Searches for the keyword align in fuzzy mode from the parameter set generated last time and prints the matched parameter combination.

    hce-wae-auto mysqld -e 4:6

    Selects the parameter combinations of No.4, No.5, and No.6 from the parameter set generated last time to generate a binary file.

    hce-wae-auto mysqld -e 1,4:6

    Selects the parameter combinations of No.1, No.4, No.5, and No.6 from the parameter set generated last time to generate a binary file.

    hce-wae-auto mysqld -e :

    Selects all parameter combinations from the parameter set generated last time to generate a binary file.

    hce-wae-auto mysqld -e 4:6 -l

    Selects the parameter combinations of No.4, No. 5, and No. 6 from the parameter set generated last time, prints the generated command, but does not execute the command.

    hce-wae-auto mysqld -e : -l

    Selects all parameter combinations from the parameter set generated last time, prints the generated command, but does not execute the command.

    hce-wae-auto mysqld --free

    Reads the configuration from the default path but does not verify parameters, generates a parameter set based on configuration parameters, automatically executes the command, and saves the parameter set after the command is executed.

    hce-wae-auto -h

    Displays command help information.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback