This topic describes how to install the SysBench test tool on an ECS instance.

Background information

SysBench is a modular, cross-platform, and multi-threaded benchmark tool that is used to evaluate the core operating parameters of a system running a heavily loaded database. It allows you to obtain the performance of your database system without the need to configure complex database benchmark parameters or install database software.


The stress tests of ApsaraDB RDS for MySQL use SysBench 1.0.18. For more information, visit SysBench.

  1. Run the following commands to install SysBench on an ECS instance:
    yum install gcc gcc-c++ autoconf automake make libtool bzr mysql-devel git mysql
    git clone
    ## Download the SysBench software package from GitHub.
    cd sysbench
    ## Open the SysBench installation directory.
    git checkout 1.0.18
    ## Switch to SysBench 1.0.18.
    ## Execute the script.
    ./configure --prefix=/usr --mandir=/usr/share/man
    ## Compile SysBench.
    make install
  2. Run the following commands to configure the SysBench client. Then the kernel can use all available CPUs to process data packets with the minimum context switches between CPUs. Two CPUs are used by default.
    sudo sh -c 'for x in /sys/class/net/eth0/queues/rx-*; do echo ffffffff>$x/rps_cpus; done'
    sudo sh -c "echo 32768 > /proc/sys/net/core/rps_sock_flow_entries"
    sudo sh -c "echo 4096 > /sys/class/net/eth0/queues/rx-0/rps_flow_cnt"
    sudo sh -c "echo 4096 > /sys/class/net/eth0/queues/rx-1/rps_flow_cnt"
    Note ffffffff specifies to use 32 CPUs. Each letter f represents four CPUs. You can change the value of this parameter based on your business requirements. For example, if your ECS instance uses eight CPUs, enter ff.