百度智能云

All Product Document

          Relational Database Service

          Benchmark Test

          When testing the performance, the users can refer to the following recommended configurations and test methods for independent performance test, or send a ticket to Baidu AI Cloud engineers for help.

          Test environment

          The customers select the following environment as needed. To make a performance comparison with other cloud vendors, pay attention to the consistency of the environments.

          Type Description
          Client configuration Recommended BCC configuration: 4-core 8G, and image CentOS 7.5 64bits
          Number of clients If a single client is a bottleneck, you are advised to adopt multi-client parallel pressure measurement, obtaining the sum of data.
          Number of concurrent connections Recommend 20 concurrent connections, and test multiple groups for the average value.
          RDS instance configuration The customers may select current mainstream configuration specifications on sale according to their needs, and higher configuration leads to better performance.
          Network Environment Make sure that the client and RDS instance are in the same AZ, and the test results are free from influence by network factors.

          Test tools

          SysBench Introduction

          SysBench is a cross-platform modularized benchmark test tool that supports multiple threads. And, you can use it for benchmark tests of CPU/memory/disk IO/thread/mutex and database. Presently, it supports such databases as MySQL/Oracle/PostgreSQL.

          SysBench 0.5 is LuaJIT-based and scriptable multi-thread benchmark test tool. Usually, It is used for database benchmark tests, aside from being used for quick search of the database host's performance without installation of the database. The following actions are under the premise of supporting the MySQL database.

          Installation method

          1. The sysBench 0.5 is usable for database benchmark test, Click here to download.
          2. SysBench's installation dependencies (based on "root" account).

            yum -y install gcc gcc-c++ autoconf automake make libtool bzr mysql-devel

          3. Execute the following command to install SysBench, and the supposed installation directory is "/home/mysql/sysbench-0.5".

            unzip sysbench-0.5.zip
            cd sysbench-0.5
            ./autogen.sh
            ./configure --prefix=/home/mysql/sysbench-0.5/
            make && make install

            Note: The current computer must be installed with MySQL client.

          Test method

          Test scenario

          This documentation is subjected to mixed pressure measurement based on "oltp.lua" script of SysBench 0.5, of which, proportion of SQLs of different types: select:update_key:update_non_key:delete:insert = 14:1:1:1:1 。

          Test data

          1. Database table structure

            CREATE TABLE sbtest ( id int(10) unsigned NOT NULL AUTO_INCREMENT, k int(10) unsigned NOT NULL DEFAULT '0', c char(120) NOT NULL DEFAULT '', pad char(60) NOT NULL DEFAULT '', PRIMARY KEY (id), KEY k (k) ) ENGINE=InnoDB DEFAULT CHARSET=utf8

          2. Data format

            id 1 k: 5273 c: 902503501-67767851-807412765-640373553-541938462-40619231-573487999-109160704-120461662-146156906 pad: 151642452-829603952-404629406-666642176-33138146

          Test SQL

          1. Query

            SELECT c FROM sbtest1 WHERE id=51 SELECT c FROM sbtest1 WHERE id BETWEEN 43 AND 43+99 SELECT c FROM sbtest1 WHERE id BETWEEN 60 AND 60+99 ORDER BY c SELECT SUM(K) FROM sbtest1 WHERE id BETWEEN 51 AND 51+99 SELECT DISTINCT c FROM sbtest1 WHERE id BETWEEN 54 AND 54+99 ORDER BY c

          2. Insert

            INSERT INTO sbtest1 (id, k, c, pad) VALUES (0, 499366, '98960633772-54743256208-23159763969-65787956584-31825798401-86270736030-94250135789-27425861392-37055945206-78163709800', '54784722736-74321090296-30487485394-35643091700-34261489188')

          3. Update

            UPDATE sbtest1 SET k=k+1 WHERE id=497476 UPDATE sbtest1 SET c='48790759921-68407130797-95399114726-08732206562-54416332000-64051686468-52626165210-54833068892-10841816541-80972096087' WHERE id=495283

          4. Delete

            DELETE FROM sbtest1 WHERE id=485435

          Test command

          1. Data Preparation

            /home/mysql/sysbench-0.5/bin/sysbench --mysql-host=xxxx --mysql-user=xxxx --mysql-password=xxxx --mysql-port=3306 --num-threads=20 --max-time=3600 --max-requests=999999999 --db-driver=mysql --mysql-table-engine=innodb --oltp-table-size=10000000 --oltp-tables-count=64 --test=/home/mysql/sysbench-0.5/share/sysbench/oltp.lua prepare

          2. Benchmark pressure measurement

            /home/mysql/sysbench-0.5/bin/sysbench --mysql-host=xxxx --mysql-user=xxxx --mysql-password=xxxx --mysql-port=3306 --num-threads=20 --max-time=3600 --max-requests=999999999 --db-driver=mysql --mysql-table-engine=innodb --oltp-table-size=10000000 --oltp-tables-count=64 --test=/home/mysql/sysbench-0.5/share/sysbench/oltp.lua run

          3. Clean the environment

            /home/mysql/sysbench-0.5/bin/sysbench --mysql-host=xxxx --mysql-user=xxxx --mysql-password=xxxx --mysql-port=3306 --num-threads=20 --max-time=3600 --max-requests=999999999 --db-driver=mysql --mysql-table-engine=innodb --oltp-table-size=10000000 --oltp-tables-count=64 --test=/home/mysql/sysbench-0.5/share/sysbench/oltp.lua cleanup

          Instructions on main parameters of SysBench

          Parameters Note
          --mysql-host=xxxx Test database's address
          --mysql-port=xxxx Test database's port
          --mysql-user=xxxx Test database's test account
          --mysql-password=xxxx Corresponding password of test database's test account
          --mysql-db=xxxx Test database's name
          --num-threads Initiated concurrent connections
          --mysql-table-engine=Innodb/MyISAM Test table storage engine
          --db-driver=mysql Indicating MySQL database awaits test
          --max-time Maximum execution time length
          --max-requests Total number of requests either-or with max_time
          --test=$sysbench_path/oltp.lua Indicating that "oltp.lua" script is invoked for "oltp" test .
          --oltp_tables_count Indicating the number of test tables to be generated.
          --oltp-table-size Indicating data volume to be filled in each table.

          Performance indexes

          TPS

          Transactions Per Second, i.e., number of "commit" successes prevails.

          QPS

          Queries Per Second, number of SQLs executed per second, (including insert, select, update, and delete).

          Response time average

          Response time avg means the average response time to each SQL in execution to one group action.

          Previous
          Overview
          Next
          FAQs