Test tool

Updated at:

SysBench is a modular, cross-platform, multi-threaded benchmark tool for evaluating database performance under heavy loads. This document covers how to install SysBench on an Elastic Compute Service (ECS) instance and run a performance test against an ApsaraDB RDS for PostgreSQL instance.

Prerequisites

Before you begin, make sure you have:

  • An ApsaraDB RDS for PostgreSQL instance with a database created

  • An ECS instance in the same VPC as the RDS instance, running a Linux distribution that supports yum

  • The endpoint, port, username, and password for your RDS instance

Install SysBench

Run the following commands on your ECS instance to download and install SysBench 1.0.12 with PostgreSQL support.

By default, SysBench is built with MySQL support. The --with-pgsql --without-mysql flags reconfigure it for PostgreSQL.

wget -c https://github.com/akopytov/sysbench/archive/1.0.12.zip
yum install make automake libtool pkgconfig libaio-devel postgresql-devel
unzip 1.0.12.zip
cd sysbench-1.0.12
# By default, Sysbench supports MySQL. In this example, configure Sysbench to support PostgreSQL.
./autogen.sh
./configure --with-pgsql --without-mysql
make
make install

Connection and test parameters

Replace the following placeholders with your actual values:

ParameterDescription
--db-driverThe database engine. Set to pgsql for PostgreSQL.
--pgsql-hostThe endpoint of the RDS instance.
--pgsql-portThe port used to connect to the RDS instance.
--pgsql-userThe username of the account used to log on to the database.
--pgsql-passwordThe password of the account used to log on to the database.
--pgsql-dbThe name of the database on the RDS instance.
--timeThe duration of the test, in seconds.
--threadsThe number of concurrent threads.
--max-requestsThe maximum number of requests for a Lua script. Set to 0 for unlimited requests.
--report-intervalHow often SysBench prints an interim report, in seconds.
--force-shutdownWhether to forcefully terminate the test.