Updated on 2024-06-12 GMT+08:00

Testing the ECS-hosted MySQL Performance

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select AP-Singapore.
  3. Click in the upper left corner of the page and choose Compute > Elastic Cloud Server.
  4. In the ECS list, locate the ECS ecs-client and click Remote Login in the Operation column.
  5. On the displayed page, click CloudShell.
  6. Enter the password you specify during the ECS ecs-client creation.
  7. Download sysbench.

    wget -c https://github.com/akopytov/sysbench/archive/1.0.18.zip

  8. Install sysbench.

    unzip 1.0.18.zip

    cd sysbench-1.0.18

    ./autogen.sh

    ./configure

    make

    make install

  9. Log in to the MySQL database and create test database sbtest.

    mysql -u root -P 3306 -h <host> -p -e "create database sbtest"

  10. Import test background data to the sbtest database.

    sysbench --db-driver=mysql --mysql-host=<host> --mysql-port=<port> --mysql-user=<user> --mysql-password=<password> --mysql-db=sbtest --table_size=250000 --tables=25 --events=0 --time=600 oltp_read_write prepare

  11. Perform a pressure test.

    sysbench --db-driver=mysql --mysql-host=<host> --mysql-port=<port> --mysql-user=<user> --mysql-password=<password> --mysql-db=sbtest --table_size=250000 --tables=25 --events=0 --time=600 --threads=<thread_num> --percentile=95 --report-interval=1 oltp_read_write run

    Delete databases and tables to release storage space only after they are migrated using DRS.

    sysbench --db-driver=mysql --mysql-host=<host> --mysql-port=<port> --mysql-user=<user> --mysql-password=<password> --mysql-db=sbtest --table_size=250000 --tables=25 --events=0 --time=600 oltp_read_write cleanup