This topic describes how to test the performance of an ApsaraDB RDS for PostgreSQL instance.
Note The stress testing duration is 180 seconds.
- Use Sysbench to load the data that is used for the test.
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
- Run the following test script to perform a stress test.
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
- Delete the data that is used for the test.
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