All Products
Search
Document Center

:Test tools

Last Updated:Aug 24, 2023

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.

Procedure

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

  1. Run the following commands to install SysBench on an ECS instance:
    sudo yum install gcc gcc-c++ autoconf automake make libtool bzr mysql-devel git mysql
    git clone https://github.com/akopytov/sysbench.git
    ## Download the SysBench software package from GitHub.
    cd sysbench
    ## Open the SysBench installation directory.
    git checkout 1.0.20
    ## Switch to SysBench 1.0.20.
    ./autogen.sh
    ## Execute the autogen.sh script.
    ./configure --prefix=/usr --mandir=/usr/share/man
    make
    ## 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.