达梦数据库8 做TPCC测试

您所在的位置:网站首页 数据库值过多 达梦数据库8 做TPCC测试

达梦数据库8 做TPCC测试

2024-07-10 11:19| 来源: 网络整理| 查看: 265

一.知识准备

 

TPC-C是专门针对联机交易处理系统(OLTP系统)的规范,一般情况下我们也把这类系统称为业务处理系统。TPC-C测试用到的模型是一个大型的商品批发销售公司,它拥有若干个分布在不同区域的商品仓库。当业务扩展的时候,公司将添加新的仓库。每个仓库负责为10个销售点供货,其中每个销售点为3000个客户提供服务,每个客户提交的订单中,平均每个订单有10项产品,所有订单中约1%的产品在其直接所属的仓库中没有存货,必须由其他区域的仓库来供货。同时,每个仓库都要维护公司销售的100000种商品的库存记录。

TPC-C测试的结果主要有两个指标,即流量指标(Throughput,简称tpmC)和性价比(Price/Performance,简称Price/tpmC)。

流量指标(Throughput,简称tpmC):按照TPC组织的定义,流量指标描述了系统在执行支付操作、订单状态查询、发货和库存状态查询这4种交易的同时,每分钟可以处理多少个新订单交易。所有交易的响应时间必须满足TPC-C测试规范的要求,且各种交易数量所占的比例也应该满足TPC-C测试规范的要求。在这种情况下,流量指标值越大说明系统的联机事务处理能力越高。

性价比(Price/Performance,简称Price/tpmc):即测试系统的整体价格与流量指标的比值,在获得相同的tpmC值的情况下,价格越低越好。

环境说明:

cpu :

内存说明:

磁盘情况:

系统情况

数据库版本:

 

测试步骤一:启动数据库并创建相关测试表

CREATE SCHEMA benchmarksql; / create table benchmarksql.warehouse ( w_id integer not null, w_ytd decimal(12,2), w_tax decimal(4,4), w_name varchar(10), w_street_1 varchar(20), w_street_2 varchar(20), w_city varchar(20), w_state char(2), w_zip char(9), cluster primary key(w_id) ); create table benchmarksql.district ( d_w_id integer not null, d_id integer not null, d_ytd decimal(12,2), d_tax decimal(4,4), d_next_o_id integer, d_name varchar(10), d_street_1 varchar(20), d_street_2 varchar(20), d_city varchar(20), d_state char(2), d_zip char(9), cluster primary key(d_w_id, d_id) ); create table benchmarksql.customer ( c_w_id integer not null, c_d_id integer not null, c_id integer not null, c_discount decimal(4,4), c_credit char(2), c_last varchar(16), c_first varchar(16), c_credit_lim decimal(12,2), c_balance decimal(12,2), c_ytd_payment float, c_payment_cnt integer, c_delivery_cnt integer, c_street_1 varchar(20), c_street_2 varchar(20), c_city varchar(20), c_state char(2), c_zip char(9), c_phone char(16), c_since timestamp, c_middle char(2), c_data varchar(500), cluster primary key(c_w_id, c_d_id, c_id) ); create sequence benchmarksql.hist_id_seq; create table benchmarksql.history ( hist_id integer not null default (benchmarksql.hist_id_seq.nextval), h_c_id integer, h_c_d_id integer, h_c_w_id integer, h_d_id integer, h_w_id integer, h_date timestamp, h_amount decimal(6,2), h_data varchar(24) )storage(branch(32,32),without counter); create table benchmarksql.oorder ( o_w_id integer not null, o_d_id integer not null, o_id integer not null, o_c_id integer, o_carrier_id integer, o_ol_cnt decimal(2,0), o_all_local decimal(1,0), o_entry_d timestamp, cluster primary key(o_w_id, o_d_id, o_id) )storage(without counter); create table benchmarksql.new_order ( no_w_id integer not null, no_d_id integer not null, no_o_id integer not null, cluster primary key(no_w_id, no_d_id, no_o_id) )storage(without counter); create table benchmarksql.order_line ( ol_w_id integer not null, ol_d_id integer not null, ol_o_id integer not null, ol_number integer not null, ol_i_id integer not null, ol_delivery_d timestamp, ol_amount decimal(6,2), ol_supply_w_id integer, ol_quantity decimal(2,0), ol_dist_info char(24), cluster primary key(ol_w_id, ol_d_id, ol_o_id, ol_number) )storage(without counter); create table benchmarksql.stock ( s_w_id integer not null, s_i_id integer not null, s_quantity decimal(4,0), s_ytd decimal(8,2), s_order_cnt integer, s_remote_cnt integer, s_data varchar(50), s_dist_01 char(24), s_dist_02 char(24), s_dist_03 char(24), s_dist_04 char(24), s_dist_05 char(24), s_dist_06 char(24), s_dist_07 char(24), s_dist_08 char(24), s_dist_09 char(24), s_dist_10 char(24), cluster primary key(s_w_id, s_i_id) ); create table benchmarksql.item ( i_id integer not null, i_name varchar(24), i_price decimal(5,2), i_data varchar(50), i_im_id integer, cluster primary key(i_id) );

测试步骤二:保证相关的表空间足够。

(说明:因为上面创建的表默认是在“main"表空间的,后续写数据的时候要保证我们的表空间够用,这个地方我们给他加6个G的数据文件)

 

ALTER TABLESPACE main ADD DATAFILE 'MAIN_DATA01.dbf' SIZE 6144;

测试步骤三:上传TPCC工具包到服务器。

测试步骤四:修改工具包中的参数文件props.dm。并检查数据库的jdbc驱动包和数据库版本是否对应

driver=dm.jdbc.driver.DmDriver conn=jdbc:dm://localhost:5236 user=SYSDBA password=Liaotao941103

warehouses=5 terminals=4 //To run specified transactions per terminal- runMins must equal zero runTxnsPerTerminal=0 //To run for specified minutes- runTxnsPerTerminal must equal zero runMins=5 //Number of total transactions per minute limitTxnsPerMin=0

//The following five values must add up to 100 newOrderWeight=45 paymentWeight=43 orderStatusWeight=4 deliveryWeight=4 stockLevelWeight=4

warehouses表示待测的仓库数, terminals表示终端数, runMins表示测试时间为5分钟,

测试步骤五:开始装载数据,即构造测试数据

./runLoader.sh props.dm

装载数据完成后会有提示:

测试步骤六:创建索引、序列:

create index ndx_customer_name on benchmarksql.customer (c_w_id, c_d_id, c_last, c_first); create index ndx_order on benchmarksql.oorder(o_w_id, o_d_id, o_c_id, o_id desc);

drop sequence benchmarksql.hist_id_seq; create or replace procedure benchmarksql.createsequence  as  n int;  stmt1 varchar(100);  begin     select max(hist_id) + 1 into n from benchmarksql.history;    stmt1:='create sequence benchmarksql.hist_id_seq start with '||n||' MAXVALUE 9223372036854775807;';    EXECUTE IMMEDIATE stmt1; end; /

--可以考虑把上面的过程中的SEQUENCE属性加上缓存属性,如CACHE 50000(最大可以缓存5万个)。

call benchmarksql.createsequence; commit;

测试步骤七 修改dm.ini参数

修改dm.ini参数 通过disql登录DM服务器并执行如下SQL命令:

--注意BUFFER和MAX_BUFFER根据实际可用内存来决定 --如果是长时间测试,如测试8小时,应该把检查点设置密集些,如CKPT_INTERVAL=300 --MAX_SESSIONS根据实际测试时终端数决定 --MAX_CONCURRENT_TRX只在连接数超过300之后,才把默认值0修改为50到200之间试试。

SP_SET_PARA_VALUE (2,'MAX_OS_MEMORY',100);

--相关参数设置略过 SP_SET_PARA_VALUE (2,'ROLLSEG_POOLS',42);

 

测试步骤八.重启服务器 ./dmserver /ssd/tpcc/DAMENG/dm.ini

测试步骤九.扩库以及日志文件、优化表 alter tablespace "ROLL" resize datafile 'ROLL.DBF' to 5000; alter database resize logfile 'DAMENG01.log' to 5000; alter database resize logfile 'DAMENG02.

--测试前执行如下SQL:

如果是压力测试(数据都可以在内存放下),可以执行下面的语句,把数据预加载到内存: select count(*) from "BENCHMARKSQL"."CUSTOMER" union all select count(*) from "BENCHMARKSQL"."DISTRICT" union all select count(*) from "BENCHMARKSQL"."ITEM" union all select count(*) from "BENCHMARKSQL"."NEW_ORDER" union all select count(*) from "BENCHMARKSQL"."OORDER" union all select count(*) from "BENCHMARKSQL"."ORDER_LINE" union all select count(*) from "BENCHMARKSQL"."STOCK" union all select count(*) from "BENCHMARKSQL"."WAREHOUSE" union all select count(*) from "BENCHMARKSQL"."HISTORY"  union all select count("C_PAYMENT_CNT") from "BENCHMARKSQL"."CUSTOMER";

测试步骤十:执行测试 --执行命令如下: ./runBenchmark.sh props.dm

测试结果

 

多版本操作冲突过多,可能是终端设置过大。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3