Configure application acceleration for an ECS instance

更新时间:
复制 MD 格式

When you purchase an ECS instance, you can use the YiTian ECS Booster to tune the performance of specific applications out of the box. For some applications, you can also use the booster on existing ECS instances. This topic describes how to install and uninstall the booster, its performance benefits, and how to disable performance acceleration.

  • Non-GPU instances: When purchasing certain Yitian, AMD, or Intel instances running Alibaba Cloud Linux 3, selecting the application performance acceleration extension for applications such as Nginx, MySQL, or Redis automatically installs both the selected application and the KeenTune tool. KeenTune then tunes the application, boosting performance by an average of 20%. (For Nginx, Spark, and x264/x265 video streaming scenarios, you can also install this extension from the details page of existing ECS instances.)

  • GPU instances: When purchasing certain GPU instances running Ubuntu 22.04/24.04, selecting the AI-enhanced application performance acceleration extension installs the AI enhancement component along with the KeenTune tool for performance tuning. This can boost performance by approximately 15% for training with AI frameworks like bevformer and openclip.

    Tuning in GPU scenarios uses the init_on_alloc=0 configuration, which can pose security risks for multi-tenant products.

Non-GPU ECS instances

How it works

When you create an instance and deploy an application that supports performance acceleration, KeenTune performs full-stack performance tuning based on the application's workload characteristics. This tuning incorporates Alibaba Cloud's expertise to optimize not only the CPU, memory, I/O, and network, but also the application itself, ensuring your services run in an optimal performance environment. You can achieve an average performance improvement of about 20% for applications such as Nginx, MySQL, Redis, and PostgreSQL, which helps you reduce costs and improve efficiency. For details on the default application versions and their performance gains, see Default application versions and performance improvements.

Supported instances

The performance acceleration extension is supported only on select Yitian, AMD, and Intel instances that run Alibaba Cloud Linux 3.

Instance type

Instance family

Operating system

Yitian instance

Alibaba Cloud Linux 3

AMD instance

Intel instance

New ECS instances

When you create a new ECS instance, you can install an application and configure performance acceleration during the creation process. After the instance is created, you can only disable performance acceleration or uninstall the application from the command line.

Install the performance acceleration extension

  1. Go to the ECS console - Custom Launch page.

  2. When you purchase a Yitian, AMD, or Intel instance, install the performance acceleration extension.

    When you create the instance, configure the following parameters. For information about other parameters, see Create an instance by using the wizard.

    Yitian instances

    • Instance: Select a Yitian instance. For more information about the supported instance families, see Supported instances.

    • Images: Select an Alibaba Cloud Linux 3 image.

    • Extension:

      • Drive: To configure eRDMA, select eRDMA Driver. The system automatically installs the driver.

      • Performance Acceleration: Select the application that you want to install, such as Nginx, MySQL, or Redis. For details on the default application versions and performance improvements, see Default application versions and performance improvements.

        Note
        • The applications available for installation are those displayed on the purchase page.

        • The Spark performance acceleration extension cannot be installed when you create an instance. It can be installed on the instance details page only after the instance is created.

      • Enable eRDMA Transparent Replacement (Optional): If you select Redis and the kernel version is 5.10.134-16 or later, you can select Enable eRDMA Transparent Replacement to switch the transport protocol from TCP to RDMA for improved network performance.

        Important
    • ENIs (Conditionally required): If you select Enable eRDMA Transparent Replacement, you must select eRDMA Interface in the Elastic Network Interface section.

    AMD instances

    • Instance: Select an AMD instance. For more information about the supported instance families, see Supported instances.

    • Images: Select an Alibaba Cloud Linux 3 image.

    • Extension:

      • Drive: To configure eRDMA, select eRDMA Driver. The system automatically installs the driver.

      • Performance Acceleration: Select the application that you want to install, such as Nginx, MySQL, or Memcached. For details on the default application versions and performance improvements, see Default application versions and performance improvements.

        Note

        The applications available for installation are subject to what is displayed on the page.

    Intel instances

    • Instance: Select an Intel instance. For more information about the supported instance families, see Supported instances.

    • Images: Select an Alibaba Cloud Linux 3 image.

    • Extension:

      • Drive: To configure eRDMA, select eRDMA Driver. The system automatically installs the driver.

      • Performance Acceleration: You can only install the MySQL application.

        For details on the default application version and performance improvements, see Default application versions and performance improvements.

    After the instance is created, the system automatically installs the selected application and uses KeenTune to perform full-stack performance tuning based on the application's workload characteristics.

Disable performance acceleration

If you no longer need performance acceleration, you can disable it by uninstalling KeenTune. The installed application will not be removed.

Important
  • Performance acceleration is designed primarily for single-application deployments. If you use a mixed-deployment scenario, we recommend that you disable performance acceleration by running the following commands.

  • When you disable performance acceleration, eRDMA transparent replacement is also disabled.

sudo bash /etc/keentune/target/scripts/set_xps_rps.sh eth0 rps disable
sudo keentune profile rollback
sudo systemctl stop keentune-target keentuned
sudo yum remove keentune-target keentuned

Uninstall the default applications

If you do not need the default applications after you create the instance, you can uninstall them. Performance acceleration remains active, and any application that you reinstall later will still benefit from it.

sudo systemctl stop <APP_Name>
sudo yum remove <APP_Name>
Note

Replace <APP_Name> with the actual application name, such as Nginx.

Existing ECS instances

If you have an existing Yitian instance (g8y, c8y, or r8y) that runs Alibaba Cloud Linux 3, you can install or uninstall the performance acceleration extension for applications on the instance details page.

  • Supported performance acceleration extensions: x264/x265, Nginx, and Spark performance acceleration extension.

    Important
    • The Spark performance acceleration extension is in private preview. To use it, contact your account manager to enable the feature.

    • The Spark performance acceleration extension is supported only on ecs.g8y.8xlarge or higher instance types and ecs.r8y.8xlarge or higher instance types.

    • The Spark performance acceleration extension does not install Spark. It only installs and configures the tuning package. After you configure the extension, you must also modify the configuration file. For more information, see Configure the Spark performance acceleration extension.

    • The Spark performance acceleration extension supports only Spark 3.3. To request support for other versions, contact your account manager.

  • For more information, see Install extensions and Uninstall extensions.

Default application versions and performance improvements

The following tables describe the default application versions and their performance improvements.

Yitian instances

Application

Default application version

Test tool

Key metric

Performance improvement

Nginx

1.20.1

wrk

RPS (requests per second)

  • HTTP/HTTPS small-packet workloads: 30%

  • Large packet + Gzip workloads: 12%

MySQL

8.0.26

sysbench

QPS (queries per second)

20% (read-only, write-only, and mixed read/write)

Redis

6.0.2

memtier-benchmark

RPS (requests per second)

25% (single-pipeline, small-packet workloads)

PostgreSQL

13.10-1.0.1

sysbench

QPS (queries per second)

20% (read-only, write-only, and mixed read/write)

Memcached

1.5.22-2.1

memtier-benchmark

RPS (requests per second)

10% to 20% (single-pipeline, small-packet workloads)

x264/x265

ffmpeg 5.0.1 or later

x264 0.164.x or later

x265 3.5 or later

ffmpeg/x264/x265

FPS (frames per second)

x264 encoding: 20% to 30%

x265 encoding: 20% to 30%

Spark performance acceleration extension

3.3

Note

Spark is not installed. Only Spark 3.3 is supported for acceleration.

TPC-DS

s (seconds)

20% to 60%

AMD instances

Application

Default application version

Test tool

Key metric

Performance improvement

Nginx

1.20.1

wrk

RPS (requests per second)

HTTP/HTTPS small-packet workloads: 10%

MySQL

8.0.26

sysbench

QPS (queries per second)

5% (read-only, write-only, and mixed read/write)

Memcached

1.5.22-2.1

memtier-benchmark

RPS (requests per second)

7% (single-pipeline, small-packet workloads)

Intel instances

Application

Default application version

Test tool

Key metric

Performance improvement

MySQL

8.0.26

sysbench

QPS (queries per second)

7% (read-only, write-only, and mixed read/write)

Note

We recommend that you use the default application versions. If you use a different version, you may not get all the optimizations. The scope of optimizations is as follows:

  • Application-level performance gains, which are available only if you use the default application versions. These include optimizations from application binary compilation and configuration.

  • OS-related performance gains, which are available regardless of the application version you use. These include boot cmdline, memory configuration, and network optimizations such as CPU affinity, XPS, RPS, and RFS.

Configure the Spark performance acceleration extension

Follow these steps to configure the Spark performance acceleration extension on the Spark master node and all worker nodes.

  1. Install the Spark performance acceleration extension on the Spark master node and all worker nodes.

    1. On the instance details page, choose Scheduled and Automated Tasks > Extension Installation/Uninstallation, and then click Install Extension.

    2. In the Install Extension dialog box, select Spark Performance Acceleration Extension from the Public Extension drop-down list, configure the following parameters, and then click Next. Follow the on-screen instructions to complete the process.

      • worker_number: The number of worker nodes in the Spark cluster.

      • worker_type: The instance type of the worker nodes. Currently, only ecs.g8y.8xlarge or higher instance types and ecs.r8y.8xlarge or higher instance types are supported.

  2. Configure ZSTD on all Spark worker nodes.

    1. Replace the JAR files.

      for jar in $SPARK_HOME/jars/zstd-*.jar; do sudo mv "$jar" "${jar}.bak"; done
      sudo cp /opt/keentune/compress/zstd-*.jar $SPARK_HOME/jars/
    2. Modify the settings in the /opt/keentune/spark.conf file.

      • To configure the compression method for writing Parquet files, set the following parameters:

        spark.sql.parquet.compression.codec    zstd
        spark.hadoop.parquet.compression.codec.zstd.level 1
        Important

        If your Parquet version is earlier than 1.13, we recommend that you upgrade to 1.13 or later to enable the ZSTD buffer pool by default. For more information about the ZSTD JNI BufferPool, see Support ZSTD JNI BufferPool.

        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-column/1.13.1/parquet-column-1.13.1.jar
        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-common/1.13.1/parquet-common-1.13.1.jar
        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-encoding/1.13.1/parquet-encoding-1.13.1.jar
        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-format-structures/1.13.1/parquet-format-structures-1.13.1.jar
        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-hadoop/1.13.1/parquet-hadoop-1.13.1.jar
        wget https://repo1.maven.org/maven2/org/apache/parquet/parquet-jackson/1.13.1/parquet-jackson-1.13.1.jar
        for file in $SPARK_HOME/jars/parquet-*.jar; do sudo mv "$file" "$file.bak"; done
        sudo cp -rf parquet-*.jar $SPARK_HOME/jars
      • To configure the data compression method for the shuffle process, set the following parameters:

        spark.io.compression.zstd.level 1
        spark.io.compression.codec    zstd
  3. If you use a separation of storage and compute architecture for Spark, you must configure the OSS endpoint and AccessKey.

    If you use OSS for storage, you must configure s3a-related parameters in the /opt/keentune/spark.conf file.

    spark.hadoop.fs.s3a.endpoint <Your_OSS_Endpoint>
    spark.hadoop.fs.s3a.access.key <Your_AccessKey_ID>
    spark.hadoop.fs.s3a.secret.key <Your_AccessKey_Secret>
  4. On the Spark master node, start the Spark cluster by using the new configuration.

    You can start the Spark cluster by using one of the following methods:

    • Restart Spark by using the /opt/keentune/spark.conf file.

      # Method 1 for job submission:
      spark-submit --properties-file=/opt/keentune/spark.conf 
      # Method 2 for job submission:
      spark-sql --properties-file=/opt/keentune/spark.conf
    • Modify your own spark.conf file based on the optimized configuration, and then restart Spark.

      # Method 1 for job submission:
      spark-submit --properties-file=${your_spark.conf}
      # Method 2 for job submission:
      spark-sql --properties-file=${your_spark.conf}

GPU-accelerated ECS instances

Function

When you create an instance with the AI enhancement extension, KeenTune is installed. KeenTune optimizes OS resources such as the CPU, memory, and network based on the characteristics of AI training workloads. It also provides capabilities such as FUSE acceleration for CPFS. In certain AI framework training scenarios, this can improve performance by 15% or more. For details about specific frameworks, model versions, and performance benefits, see Frameworks, model versions, and performance.

Applicable instances

Instance type

Instance family

Operating system

GPU-accelerated ECS instances (gn, vgn, and sgn series)

  • Alibaba Cloud public image Ubuntu 22.04

  • Alibaba Cloud public image Ubuntu 24.04

Elastic Bare Metal Instance types

New ECS instances

You can install and configure performance acceleration when you create a new ECS instance. After the instance is created, you can uninstall the extension from the instance details page.

Installation

  1. Go to the ECS console - Custom Launch page.

  2. When you purchase a supported GPU instance, install the performance acceleration extension. Note the following configurations during the purchase. For information about other parameter settings, see Create an instance by using the wizard.

  1. After the instance is created, KeenTune performs full-stack performance tuning based on the application's characteristics and enables capabilities such as FUSE acceleration for CPFS.

    Installing the ai enhancement extension enables FUSE acceleration, which is critical for scenarios that use Cloud Paralleled File System (CPFS). This feature is currently supported only on the Alibaba Cloud public image for Ubuntu 24.04.
Important
  • Restart the system to apply all tuning optimizations.

  • The ai enhancement extension is compatible with the GPU and eRDMA extensions.

Uninstallation

On the instance details page, in the Installed Extensions list, click Detach in the Operation column.

Frameworks, models, and performance

We tested the performance of the OpenCLIP and BEVFormer models on mainstream GPU instances before and after optimization. The test environment and optimization results are provided below.

Test environment

Parameter

Description

operating system

Alibaba Cloud public image Ubuntu 22.04, Alibaba Cloud public image Ubuntu 24.04

kernel version

5.15.0-144-generic

gcc version

11.4.0

glibc version

2.35

KeenTune

3.2.61

Python

3.10.12

PyTorch

2.7.0a0+ecf3bae40a.nv25.2

NCCL

2.26.2

mmcv-full

1.7.2

mmdet3d

1.0.0rc4

Performance results

Instance type

Model

Training/inference

Throughput improvement (samples/s)

ebmgn8v.48xlarge

BEVFormer

bevformer_base training

FP32 (10%+)

FP16 (8%+)

OpenCLIP

RN50 inference

20%+

RN50 training

25%+

The table below shows the performance improvement from FUSE acceleration for CPFS.

FUSE acceleration for CPFS is currently supported only on the Alibaba Cloud public image for Ubuntu 24.04. The following test data is based on this operating system version.

Metric

Use case

Value

Improvement

Remarks

bandwidth

Buffered read (1M IO)

40 GB/s

2.5x

Native FUSE is approximately 15 GB/s

bandwidth

Buffered write (1M IO)

40 GB/s

10x

Native FUSE is approximately 4 GB/s

IOPS

Direct read (4k IO)

1,000,000

2.5x

Native FUSE is approximately 400,000 IOPS