zoukankan      html  css  js  c++  java
  • benchmark测试PostgreSQL数据库OLTP性能

    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.pg
    driver=org.postgresql.Driver
    conn=jdbc:postgresql://localhost:5432/benchmarksql#可配置
    user=benchmarksql#可配置
    password=password#可配置
    warehouses=1#可配置
    terminals=1#配置
    //To run specified transactions per terminal- runMins must equal zero
    runTxnsPerTerminal=10#可配置为0
    //To run for specified minutes- runTxnsPerTerminal must equal zero
    runMins=0#可配置测试时间
    //Number of total transactions per minute
    limitTxnsPerMin=300
    //The following five values must add up to 100
    //The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
    newOrderWeight=45
    paymentWeight=43
    orderStatusWeight=4
    deliveryWeight=4
    stockLevelWeight=4
    5,创建测试用户名和密码 和测试数据库
    postgres=# create user benchmarksql with superuser password 'password';
    CREATE ROLE
    postgres=# create database benchmarksql owner benchmarksql;
    CREATE DATABASE
    6,创建测试表结构
    ./runSQL.sh props.pg sqlTableCreates
    7,查看已经创建的表结构
     ./psql benchmarksql benchmarksql
    dt+
    8,导入测试数据
     ./runLoader.sh props.pg numWarehouses 1
    9,为测试表创建索引
    ./runSQL.sh props.pg sqlIndexCreates
    10,在benchmark连接benchmark数据库用户下查看创建的索引
    di
    11,开始测试
    ./runBenchmark.sh props.pg
  • 相关阅读:
    在实践中不断总结和提升
    [转]态度的魔力 Net
    回答的智慧 Net
    [转] 【领导必读】唐僧为什么可以领导孙悟空 Net
    [转载]人生感悟:8个笑话 8味人生 Net
    人生成功的十大说话技巧 Net
    最新人生感悟语句摘选 Net
    2012注定是收获的一年,奋斗才刚刚开始
    程序员职业发展的绊脚石思想的枷锁
    AgileEAS.NET5.0界面设计器使用说明书(上)
  • 原文地址:https://www.cnblogs.com/songyuejie/p/4029072.html
Copyright © 2011-2022 走看看