All Products
Search
Document Center

ApsaraDB RDS:Test procedure

Last Updated:Mar 28, 2026

Run a Sysbench stress test against an ApsaraDB RDS for PostgreSQL instance to measure Online Transaction Processing (OLTP) performance. The test uses the OLTP combined read-write workload and consists of three phases: load test data, run the stress test, then clean up.

Prerequisites

Before you begin, ensure that you have:

  • An ApsaraDB RDS for PostgreSQL instance with a database named sbtest

  • Sysbench installed on your client machine

  • The instance endpoint, port, username, and password

Run the stress test

Each phase uses --time=180, so each phase runs for 180 seconds.

Step 1: Load test data

Load the test dataset using 20 concurrent threads.

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=64 \
  --oltp-table-size=10000000 \
  --time=180 \
  --max-requests=0 \
  --threads=20 \
  --report-interval=5 \
  --forced-shutdown=1 \
  prepare

Step 2: Run the stress test

Run the OLTP combined read-write workload using 64 concurrent threads.

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=64 \
  --oltp-table-size=10000000 \
  --time=180 \
  --max-requests=0 \
  --threads=64 \
  --report-interval=5 \
  --forced-shutdown=1 \
  run

Step 3: Clean up test data

Remove the test dataset using 200 concurrent threads.

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=64 \
  --oltp-table-size=10000000 \
  --time=180 \
  --max-requests=0 \
  --threads=200 \
  --report-interval=5 \
  --forced-shutdown=1 \
  cleanup

Sysbench parameter reference

Replace the placeholders in the commands with your instance values before running.

ParameterDescriptionValue
--pgsql-hostInternal endpoint of the RDS instance<host>
--pgsql-portPort of the RDS instance5432
--pgsql-userDatabase username<username>
--pgsql-passwordPassword for the database user<password>
--pgsql-dbTarget database namesbtest
--oltp-tables-countNumber of test tables64
--oltp-table-sizeNumber of rows per table10000000
--threadsNumber of concurrent threads (varies by phase)20 (prepare) / 64 (run) / 200 (cleanup)
--timeDuration of each phase in seconds180
--max-requestsMaximum number of requests; 0 means unlimited0
--report-intervalProgress report interval in seconds5
--forced-shutdownForce shutdown after --time expires; 1 means enabled1