本文介紹測試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
文檔內容是否對您有幫助?