benchmark测试PostgreSQL数据库OLTP性能
2014-10-16 16:13 DataBases 阅读(1097) 评论(0) 收藏 举报1,安装配置PostgreSQL数据库
2,下载地址:http://sourceforge.net/projects/benchmarksql/?source=navbar
Required:JDK7
3,解压 unzip benchmarksql-4.1.0.zip
4,修改benchmark的数据库连接配置信息
测试参数根据自己的情况和需要设置
[postgres@localhost run]$ vi props.pgdriver=org.postgresql.Driverconn=jdbc:postgresql://localhost:5432/benchmarksql#可配置user=benchmarksql#可配置password=password#可配置warehouses=1#可配置terminals=1#配置//To run specified transactions per terminal- runMins must equal zerorunTxnsPerTerminal=10#可配置为0//To run for specified minutes- runTxnsPerTerminal must equal zerorunMins=0#可配置测试时间//Number of total transactions per minutelimitTxnsPerMin=300//The following five values must add up to 100//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C specnewOrderWeight=45paymentWeight=43orderStatusWeight=4deliveryWeight=4stockLevelWeight=45,创建测试用户名和密码 和测试数据库
postgres=# create user benchmarksql with superuser password 'password';CREATE ROLEpostgres=# create database benchmarksql owner benchmarksql;CREATE DATABASE6,创建测试表结构
./runSQL.sh props.pg sqlTableCreates7,查看已经创建的表结构
./psql benchmarksql benchmarksql
\dt+
8,导入测试数据
./runLoader.sh props.pg numWarehouses 19,为测试表创建索引
./runSQL.sh props.pg sqlIndexCreates10,在benchmark连接benchmark数据库用户下查看创建的索引
\di
11,开始测试
./runBenchmark.sh props.pg
浙公网安备 33010602011771号