All Products
Search
Document Center

Elastic Compute Service:Deploy Redis on eRDMA-enhanced instances

Last Updated:Mar 26, 2024

Elastic Remote Direct Memory Access (eRDMA) allows you to process requests at ultra-low latency. This topic describes how to deploy Shared Memory Communication (SMC) and Redis on eRDMA-enhanced Elastic Compute Service (ECS) instances and use SMC to test the request processing capability of Redis.

Background information

SMC is a high-performance protocol stack that functions in kernel space, uses RDMA technology, and is compatible with the socket layer. SMC is provided in the following variations based on shared memory technology: Shared Memory Communications - Direct Memory Access (SMC-D), which uses internal shared memory (ISM) technology, and Shared Memory Communications over Remote Direct Memory Access (SMC-R), which uses RDMA technology. This topic describes how to deploy SMC-R and use SMC-R to perform tests.

Step 1: Deploy SMC

In this step, you must create two ECS instances: Instance C that acts as a client and Instance D that acts as a server. In this example, ECS instances that have the following configurations are created:

  • Instance type: ecs.c7re.8xlarge.

  • Image: Alibaba Cloud Linux 3.2104 LTS 64-bit.

  • The ECS instances belong to the same security group and can communicate with each other over the internal network.

  • The primary elastic network interface (ENI) of Instance D is assigned the primary private IP address 192.168.5.49.

  1. Create and connect to two eRDMA-enhanced ECS instances: Instance C and Instance D.

    For more information, see Configure eRDMA on an enterprise-level instance.

  2. Run the following command on Instance C and Instance D to deploy the SMC-R module:

    modprobe smc && modinfo smc
  3. Run the following command on Instance C and Instance D to disable IPv6 to ensure that eRDMA connections can be established on the instances:

    sysctl net.ipv6.conf.all.disable_ipv6=1
  4. Run the following command on Instance C and Instance D to enable the SMC eRDMA feature. This way, traffic preferentially runs on eRDMA.

    sysctl net.smc.tcp2smc=1
  5. Run the following command on Instance C and Instance D to install smc-tools:

    smc-tools is a toolkit from IBM that allows you to monitor and diagnose SMC-R from multiple aspects. smc-tools consists of the following modules:

    • smcr: displays statistics about SMC-R resources.

    • smcss: displays information about SMC sockets.

    yum install -y smc-tools

    After smc-tools is installed, you can run the smcss -a command to query the current SMC connections.smcss查看

Step 2: Deploy open source Redis

After you deploy SMC on Instance C and Instance D, you can deploy Redis on the instances. This section describes how to deploy Redis on Instance C that acts as a Redis client and Instance D that acts as a Redis server.

  1. Connect to Instance C and Instance D. For more information, see Connection method overview.

  2. Install open source Redis on Instance C and Instance D.

    1. Run the following command to download the installation package for open source Redis:

      wget https://github.com/redis/redis/archive/refs/tags/6.2.5.zip

      For information about Redis versions, see Redis GitHub Repo.

    2. Run the following command to decompress the installation package and then go to the directory to which the installation package is decompressed:

      unzip 6.2.5.zip && cd redis-6.2.5 
      Note

      Make sure that the unzip utility is installed on Instance C and Instance D. If the utility is not installed on the instances, run the yum install -y unzip zip command to install the utility.

    3. Run the following command to compile and install Redis:

      make -j
  3. Run the following command on Instance D to start Redis:

    ./src/redis-server --bind 192.168.5.49 --port 6379 --protected-mode no --save
    Note

    192.168.5.49 is the primary private IP address of the primary ENI on Instance D. 6379 is the number of the port on which Redis listens. Replace the primary private IP address and port number with actual values.

    community-redis-server

  4. Connect to and test the Redis server from the Redis client.

    • Run the following command to connect to the Redis server:

      ./src/redis-cli -h 192.168.5.49 -p 6379
    • Perform a stress test by using redis-benchmark.

      Run the following command to simulate 100 clients sending 1,000,000 SET commands to the server:

      ./src/redis-benchmark -h 192.168.5.49 -p 6379 -n 1000000 -t set -c 100

Alternatively, you can start multiple stress test processes to perform a combined test after you enable SMC-R. Perform the preceding steps to deploy another Redis client, start multiple stress test processes on the two Redis clients, and then view the number of operations per second (OPS) on the Redis server.

  • Sample command that is used to start eight stress test processes for SET commands:

    ./src/redis-benchmark -h 192.168.5.49 -p 6379 -n 100000000 -t set --threads 8 -c 100
  • Sample command that is used to start eight stress test processes for GET commands:

    ./src/redis-benchmark -h 192.168.5.49 -p 6379 -n 1000000 -t get --threads 8 -c 100
  • Sample command that is used to view the number of OPS on the Redis server:

    ./src/redis-cli -h 192.168.5.49 -p 6379 info | grep instantaneous_ops_per_sec
    Note

    Open a new connection window and then enter the preceding command.