Test tool
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
yumThe 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 installConnection and test parameters
Replace the following placeholders with your actual values:
| Parameter | Description |
|---|---|
--db-driver | The database engine. Set to pgsql for PostgreSQL. |
--pgsql-host | The endpoint of the RDS instance. |
--pgsql-port | The port used to connect to the RDS instance. |
--pgsql-user | The username of the account used to log on to the database. |
--pgsql-password | The password of the account used to log on to the database. |
--pgsql-db | The name of the database on the RDS instance. |
--time | The duration of the test, in seconds. |
--threads | The number of concurrent threads. |
--max-requests | The maximum number of requests for a Lua script. Set to 0 for unlimited requests. |
--report-interval | How often SysBench prints an interim report, in seconds. |
--force-shutdown | Whether to forcefully terminate the test. |