本文介紹測試RDS PostgreSQL執行個體效能的步驟。
說明 本次壓測時間統一為180秒。
- 使用sysbench工具載入測試資料。
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 - 執行如下測試指令碼進行壓測。
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 - 清理資料。
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