Some enterprise-level Elastic Compute Service (ECS) instances support elastic Remote Direct Memory Access (eRDMA). This feature delivers a high-performance RDMA network service that offers ultra-low latency, high throughput, and high elasticity without requiring changes to your existing network architecture. This topic describes how to enable eRDMA on an enterprise-level ECS instance.
Limits
Limitations | Description |
Instance type | The following instance families support eRDMA: Some instance types, such as g9ae, c9ae, r9ae, g9a, c9a, r9a, and u2a, require four or more vCPUs to support eRDMA. |
Image |
Note The images that are available vary based on the instance type. The images available on the instance buy page are final. |
Number of eRDMA devices | To query the maximum number of ERIs that you can bind to an ECS instance of a specific instance type, call the DescribeInstanceTypes operation and check the value of the EriQuantity parameter in the response. A value of 0 indicates that you cannot bind an ERI to an ECS instance of the instance type. |
Network limits |
|
Configure eRDMA for an enterprise-level instance
Configure eRDMA when you create an instance
If the operating system does not support the eRDMA driver or if the automatic installation fails, you can install the driver using a script or by performing a manual installation after the instance is created. For more information, see Configure eRDMA for an existing instance.
After the instance starts, the eRDMA driver installation may take some time to complete.
Create an enterprise-level instance that supports ERIs. During the creation process, take note of the following configuration items. For information about other parameters, see Create an instance using the wizard.
Instance and Image: Select an instance type that supports eRDMA and select the option to install the eRDMA driver.
Instance: For more information, see Limits.
Image: Select Public Image and then select Install eRDMA driver. The eRDMA driver is automatically installed when the instance starts. You do not need to perform a manual installation.

ENI: To the right of Primary ENI, enable the ERI feature to attach an ERI to the ECS instance.
NoteWhen you purchase an enterprise-level instance, you can enable the ERI feature only for the primary ENI. To configure eRDMA for a secondary ENI, you can enable the ERI feature for the secondary ENI in the console or by calling an API operation. For more information, see Elastic RDMA Interface (ERI).
Configure eRDMA for an existing instance
Make sure that the instance type is in the list of instance types that support eRDMA.
The instance type must support eRDMA.
Verify that eRDMA is configured correctly for the instance.
First, verify that eRDMA is configured correctly for the instance. For more information, see Verify eRDMA configurations.
If you confirm that eRDMA is not configured for the instance, perform the following steps to install the eRDMA driver and attach an ERI to the instance.
Install the eRDMA driver on the instance.
If you do not select the eRDMA driver when you create the instance, the driver is not automatically installed. You must then install it manually or using a script.
Script-based installation: The latest stable version of the driver package is downloaded by default.
Manual installation: You can download a specific version of the driver package.
Install using a one-click script
Run the following command to download the latest stable version of the driver package.
curl -O http://mirrors.cloud.aliyuncs.com/erdma/env_setup.shRun the following command to install the downloaded driver package.
sudo /bin/bash env_setup.sh > /var/log/erdma_install.log 2>&1After you run the installation script, the script automatically installs the software dependencies required for the eRDMA driver and then installs the eRDMA driver. Wait for the script to finish running.
NoteIf the driver fails to install using the script, check the installation log. The path of the installation log is
/var/log/erdma_install.log.
Install manually step by step
Run the following command to update the prerequisite software packages.
For Alibaba Cloud Linux 3, CentOS, or Anolis OS:
sudo yum update -yFor Ubuntu: You do not need to perform an update. Skip this step.
Run the following commands in sequence to view the latest kernel package version and the kernel version of the operating system.
rpm -qa | grep kernel # View the latest kernel package version. uname -r # View the kernel version of the operating system.If the command output is similar to the following example, the versions are consistent and no further action is required. If the versions are inconsistent, restart the instance for the changes to take effect.

Run the following command to install the dependency packages.
For x86-based instances, perform the following operations:
For Alibaba Cloud Linux 3, CentOS, or Anolis OS:
sudo yum install gcc-c++ dkms cmake kernel-devel kernel-headers libnl3 libnl3-develFor Ubuntu:
sudo apt-get install dkms cmake libnl-3-dev libnl-route-3-dev linux-headers-generic
For Arm-based instances, build tasks are run based on the source code. This process requires many software dependencies that may change. You can skip this step and run the installation script directly. If the installation script fails, it prompts you to install the required software dependencies. Install the dependencies as prompted and then run the software installation again.
Run the following command to download the driver installation package.
Obtain the software package from an internal network address.
wget http://mirrors.cloud.aliyuncs.com/erdma/erdma_installer-latest.tar.gzObtain the software package from an Internet address.
wget https://mirrors.aliyun.com/erdma/erdma_installer-latest.tar.gz
By default, the latest version of the driver installation package is downloaded. You can also download a specific version of the driver package. For information about the release of different versions of the eRDMA installation package, see Step 2: Install the eRDMA driver for an ECS instance.
Run the following command to decompress the installation package and go to the file directory.
tar -xvf erdma_installer-latest.tar.gz && cd erdma_installerRun the following command to install the driver.
Method 1: Manually confirm the uninstallation and automatic download steps during the installation process.
sudo sh install.shMethod 2: Install without confirmation.
sudo sh install.sh --batch
Confirm the installation result based on the returned information.
If the following information is returned, the driver is installed.

If the following information is returned, the driver failed to install. Perform the operations as prompted and then try to install the driver again.
NoteIf you use a CentOS 7 system and a message that indicates missing software packages appears when you reinstall the driver, but you cannot obtain the packages using
yum, you may need to run theyum install -y epel-releasecommand to install the EPEL repository before you can obtain the packages.
Attach an ERI to the instance.
You can attach an ERI to an instance in one of the following ways.
NoteTo query the maximum number of ERIs that you can bind to an ECS instance of a specific instance type, call the DescribeInstanceTypes operation and check the value of the EriQuantity parameter in the response. A value of 0 indicates that you cannot bind an ERI to an ECS instance of the instance type.
Enable the ERI feature for an ENI that is bound to an ECS instance
You can enable the ERI feature for an ENI that is bound to an ECS instance by modifying the attributes of the ENI. For more information, see the Change the status of the ERI feature for an existing ENI section of the "ERIs" topic.
Create an ERI and bind the ERI to an ECS instance
For information about how to create an ERI, see the Separately create an ERI section of the "ERIs" topic.
For information about how to bind an ERI to an ECS instance, see Bind a secondary ENI.
Call API operations to create an ERI and bind the ERI to an ECS instance
Perform the following steps:
Call an API operation to create an ERI.
Call the CreateNetworkInterface operation to create an ENI and set the NetworkInterfaceTrafficMode parameter to HighPerformance to enable the ERI feature for the ENI.
After the call is successful, record the return value of the
NetworkInterfaceIdparameter, which is the ERI ID.Set the NetworkInterfaceId parameter to the return value recorded in the preceding step and the InstanceId parameter to the ID of an ECS instance and call the AttachNetworkInterface operation to bind the ERI to the ECS instance.
ImportantIf the instance type of the ECS instance supports multiple ERIs per instance, we recommend that you set the NetworkCardIndex parameter to a different value for each ERI when you bind multiple ERIs to the instance. This ensures that the ERIs are bound to different channels and the maximum network bandwidth is achieved for the instance. For more information, see Network card indexes.
Test the eRDMA write latency of an instance
You can install perftest and then use ib_write_lat to test the write latency on two enterprise-level instances that have eRDMA configured. For more information about perftest tests, see perftest test set.
Prerequisites
Prepare two enterprise-level instances that have eRDMA configured. The eRDMA software stack must be installed and ERIs must be attached to the instances. One instance serves as the server and the other as the client.
Make sure that the network is configured correctly and that the two servers can communicate with each other over the internal network. For more information, see Enable service interconnection between ECS instances.
Procedure
Remotely connect to the two instances.
For more information, see Connect to a Linux instance using Workbench.
Verify that the eRDMA configurations on both instances are correct.
For more information, see Verify eRDMA configurations.
Run the following commands on the two instances to install the perftest tool.
You can download the perftest package from the official perftest repository and install perftest, or use a Yellowdog Updater, Modified (YUM) or Advanced Packaging Tool (APT) repository to install perftest.
Official perftest repository
Enable public bandwidth for an ECS instance on which you want to install perftest. For more information, see Enable public bandwidth.
Download the perftest package from the official perftest repository and install perftest.
YUM or APT repository
NoteDifferent versions of perftest are included in the repositories of different Linux distributions. Incompatibility may occur. To prevent incompatibility, we recommend that you identify the Linux distribution run by the ECS instance on which you want to install perftest and install the perftest version included in the repository of the same Linux distribution. Otherwise, download the perftest package from the official perftest repository and install perftest.
Alibaba Cloud Linux 3/CentOS/Anolis OS
sudo yum install perftest -yUbuntu
sudo apt install perftest -y
Test the eRDMA network latency against the expected performance.
On the server instance, run the following command to start
ib_write_latas a server that listens for connections from the client.ib_write_lat -R -a -F-R: uses RDMA_CM to establish a connection.ImportantBy default, CPU-based instance types that support eRDMA install the eRDMA kernel driver in Standard mode. In this mode, only the RDMA_CM connection establishment method is supported. For more information, see Connection establishment methods.
By default, perftest establishes out-of-band (OOB) connections. When you run a perftest test on a CPU-based instance, you can specify the -R parameter on both the server and the client to use the RDMA_CM connection establishment method. Otherwise, an exception may occur when a connection is established.
You can also use the command line to make the RDMA_CM and OOB connection establishment methods compatible. For more information, see Modify the connection establishment modes of eRDMA and bRPC to ensure compatibility. After you make the methods compatible, you do not need to add the -R parameter to the command.
-a: runs tests for all message sizes, from 2 bytes to 2^23 bytes. This lets you test the effect of different message sizes on latency.-F: forcefully overwrites any existing connection. This means that if a connection was previously established, using the-Foption ignores the existing connection and forcefully establishes a new one.
On the client instance, run the following command to start
ib_write_latand connect to the server.ib_write_lat -R -a -F <server_ip>Replace
<server_ip>with the private IP address of the network interface card (NIC) for which the ERI feature is enabled on the server ECS instance. For information about how to obtain an IP address, see View IP addresses.View the test results.
After the client test is complete,
ib_write_latoutputs the test configuration information, connection information, and performance test results. The results include latency-related statistics, such as the minimum, maximum, and average latency.