文档

测试步骤

更新时间:

本文介绍测试RDS PostgreSQL实例性能的步骤。

说明 本次压测时间统一为180秒。
  1. 使用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
  2. 执行如下测试脚本进行压测。
    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
  3. 清理数据。
    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
  • 本页导读 (1)
文档反馈