This topic introduces the SysBench test tool that is used to test the performance of an ApsaraDB RDS for PostgreSQL instance. This topic also describes how to install the SysBench test tool on an Elastic Compute Service (ECS) instance.
Background information
SysBench is a modular, cross-platform, and multi-threaded benchmark tool. You can use it to evaluate the performance of core parameters of a system that runs a database of heavy loads. SysBench allows you to obtain the performance of your database system in an efficient manner.
Install SysBench
Download and install SysBench.
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
Parameter description
Parameter | Description |
db-driver | The database engine. |
pgsql-host | The endpoint of the RDS instance. |
pgsql-port | The port number that is used to connect to the RDS instance. |
pgsql-user | The username of the account that is used to log on to the database. |
pgsql-password | The password of the account that is used to log on to the database. |
pgsql-db | The name of the database that belongs to the RDS instance. |
time | The time required for the test. |
threads | The number of concurrent threads. |
max-requests | The maximum number of requests that are allowed for a Lua script. If you set this parameter to 0, no limits are imposed on the number of requests. |
report-interval | The interval at which a stress test report is generated. Unit: seconds. |
force-shutdown | Specifies whether to forcefully terminate the test. |