You need to enable JavaScript to run this app.
RDS for PostgreSQL

RDS for PostgreSQL

Copy page
Download PDF
Performance document
Test methods
Copy page
Download PDF
Test methods
This topic describes the environments, tools, steps, and metrics used for RDS for PostgreSQL performance testing.​
Test Environment​
  • Region: cn-beijing-autodriving, with S20 models in the node pool​
  • Availability zone: Availability zone B​
  • ECS of client: Computation type c3i 32 vCPU 64 GiB, Specification code: ecs.c3i.8xlarge​
  • OS mirror image: CentOS 8.3 64-bit version​
tip​
Because you must install additional compilation tools for the stress test tools, we recommend you bind the ECS instance to an EIP.​
Test tool​
SysBench is a modular benchmarking test tool that supports multiple platforms and multiple threads. It evaluates the performance of core parameters when the system runs a high-load database to gain quick insights into the database system performance.​
Downloading and installing the testing tool​
​
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​
# SysBench supports MySQL by default. Please add PostgreSQL to the supported list here.​
./autogen.sh​
./configure --with-pgsql --without-mysql​
make​
make install​
​
Test steps​
Replace the database, username, password, port, host domain, and other information in the command correctly as needed. The duration of this performance test is 180 seconds.​
1. Initializing test data​
Use the sysbench tool to load test data.The command is as follows:​
​
sysbench ./tests/include/oltp_legacy/oltp.lua \​
--db-driver=pgsql \​
--pgsql-db=sbtest \​
--pgsql-user=<username> \​
--pgsql-password=<password> \​
--pgsql-port=5432 \​
--pgsql-host=<host> \​
--oltp-tables-count=32 \​
--oltp-table-size=10000000 \​
--time=180 \​
--max-requests=0 \​
--threads=20 \​
--report-interval=5 \​
--forced-shutdown=1 \​
prepare​
​
2. Starting test​
Execute the following command to test the performance. During the testing process, the threads parameter will be adjusted to find the optimal number of threads that achieve the best performance and record the results.​
​
sysbench ./tests/include/oltp_legacy/oltp.lua \​
--db-driver=pgsql \​
--pgsql-db=sbtest \​
--pgsql-user=<username> \​
--pgsql-password=<password> \​
--pgsql-port=5432 \​
--pgsql-host=<host> \​
--oltp-tables-count=32 \​
--oltp-table-size=10000000 \​
--time=180 \ ​
--max-requests=0 \​
--threads=64 \​
--report-interval=5 \​
--forced-shutdown=1 \​
run​
​
3. Clearing test data​
After the performance test is completed, clear the test data with the following command.​
​
sysbench ./tests/include/oltp_legacy/oltp.lua \​
--db-driver=pgsql \​
--pgsql-db=sbtest \​
--pgsql-user=<username> \​
--pgsql-password=<password> \​
--pgsql-port=5432 \​
--pgsql-host=<host> \​
--oltp-tables-count=32 \​
--oltp-table-size=10000000 \​
--time=180 \​
--max-requests=0 \​
--threads=200 \​
--report-interval=5 \​
--forced-shutdown=1 \​
cleanup​
​
Test metrics​
  • TPS​
  • Transactions Per Second: the number of transactions executed per second by the database.​
  • QPS​
  • Queries Per Second: the number of SQL queries executed per second by the database. It contains Read, Write, and Other query types.​
The test results are as follows.​
For details about test results, refer to Performance test results.​
​
Last updated: 2026.06.04 15:16:45