TPC-C测试
TPC-C 于 1992 年 7 月 23 日认可为新的基准测试。TPC(Transaction Processing Performance Council,事务处理性能委员会)-C是衡量联机事务处理(OLTP,Online TransactionProcessing)系统的工业标准,是行业中公认的权威和最为复杂的在线事务处理基准测试。它通过模拟仓库和订单管理系统,测试广泛的数据库功能,包括查询、更新和 mini-batch事务(队列式小批量事务)。TPC-C基准测试针对一种模拟订单录入与销售环境测量每分钟事务(tpmC-transactions per minute)吞吐量。
Ø 标准测试模拟的程序环境
测试用到的模型是一个大型的批发销售公司,在地理分布的多个区域有业务,并且使用仓库管理。当业务扩展的时候,公司将添加新的仓库。每个仓库负责十个区域的供货,每个区域 3000 个客户服务,每个仓库维护 100000 种商品的库存纪录。如下图所示:
TPC-C 标准测试系统的数据库有 9 个表组成,他们之间的关系如下图所示:
其中W 代表仓库数,框中的数字表示该表将存放的记录条数,K代表1000,仓库数的调整在测试中能够体现数据库所能支持的数据规模的能力。每个 Warehouse 的数据量,其大小约为 76823.04KB,可以有小量的变化,因为测试过程中将会插入或删除现有记录。可以根据每个Warehouse的数据量,计算测试过程中的数据总量。
计算公式为:数据总量(KB)≈ Warehouse个数*76823.04KB
以10个Warehouse的数据量为例计算其数据总量大小约为:768230.4KB
Ø 标准测试模拟的事务处理
TPC-C 标准测试模拟了 5 种事务处理,通过这些事务处理来模拟真实的用户操作,事务分别为新订单(New-Order)、支付操作(Payment)、订单状态查询(Order-Status)、发货(Delivery)、库存状态查询(Stock-Level)。下面将对其执行的事务内容及特点进行详细介绍.
1.新订单(New-Order)
事务内容:对于任意一个客户端,从固定的仓库随机选取 5-15 件商品,创建新订单.其中 1%的订单要由假想的用户操作失败而回滚。
主要特点:中量级、读写频繁、要求响应快.
2.支付操作(Payment)
事务内容:对于任意一个客户端,从固定的仓库随机选取一个辖区及其内用
户,采用随机的金额支付一笔订单,并作相应历史纪录。
主要特点:轻量级,读写频繁,要求响应快
3.订单状态查询(Order-Status)
事务内容:对于任意一个客户端,从固定的仓库随机选取一个辖区及其内用户,读取其最后一条订单,显示订单内每件商品的状态。
主要特点:中量级,只读频率低,要求响应快
4.发货(Delivery)
事务内容:对于任意一个客户端,随机选取一个发货包,更新被处理订单的用户余额,并把该订单从新订单中删除.
主要特点:1-10 个批量,读写频率低,较宽松的响应时间
5.库存状态查询(Stock-Level)
事物内容:对于任意一个客户端,从固定的仓库和辖区随机选取最后 20 条订单,查看订单中所有的货物的库存,计算并显示所有库存低于随机生成域值的商品数量.
主要特点:重量级,只读频率低,较宽松的响应时间.
Ø 标准中事务处理需要满足的条件
TPC-C 标准测试要求事务处理必须满足下面的两组条件.
1. 事务处理要满足的时间及占有的比例
五种事务要满足的时间要求,包括键盘操作时间(Keying Time),思考时间
因子(Think Time Distribution)以及 90%的响应时间(90th Percentile Response Time)限制。
2. 事务要满足的隔离级别
TPC-C 测试过程中应该满足的隔离级别要求。要求只能高不能低。
T1到T5分别指五种事务:New-Order,Payment,Order-Status,Delivery,Stock-Level。
P0到P3分别指:脏写,脏读,非重复性读,幻影
Ø 测试指标
TPC-C测试的结果主要有两个指标,即流量指标(Throughput,简称tpmC)和性价比(Price/Performance,简称Price/tpmC)。
流量指标(Throughput,简称tpmC):按照TPC组织的定义,流量指标描述了系统在执行支付操作、订单状态查询、发货和库存状态查询这4种交易的同时,每分钟可以处理多少个新订单交易。所有交易的响应时间必须满 足TPC-C测试规范的要求,且各种交易数量所占的比例也应该满足TPC-C测试规范的要求。在这种情况下,流量指标值越大说明系统的联机事务处理能力越高。
性价比(Price/Performance,简称Price/tpmc):即测试系统的整体价格与流量指标的比值,在获得相同的tpmC值的情况下,价格越低越好。
Ø TPC-C的测试工具
常用的开源TPC-C基准测试工具有BenchmarkSQL, dbt2-v0.23等等。
benchmarkSQL的安装部署
(1).JDK1.7
(2).apache ant
benchmarkSQL的配置文件解析:
第一个部分是JDBC连接信息。
第二个部分是场景设置,其中runTxnsPerTerminal是每分钟执行事务数,runMins是执行多少分钟,limitTxnsPerMin是每分钟执行的事务总数,并且这里时间的单位是分钟。场景执行的最低条件是第二项大于0。
第三个部分是TPCC中,五个事务执行的比例,总数等于100,通常不用修改。
典型配置:
Oracle配置需要修改的地方:
ü 每个仓库要100M的空间1000个需要100G的存储表空间。
ü 设置ORACLE 批量提交参数:
SQL> alter system set commit_write='batch,nowait';
ü 使用强制软解析
SQL> alter system set cursor_sharing=force;
ü 使用O_DIRECT
SQL>alter system set filesystemio_options=directioscope=spfile;
SQL> alter system set disk_asynch_io=falsescope=spfile;
ü 修改最大连接数,打开游标数
SQL> alter system set processes=3000 scope=spfile;
SQL> ALTER SYSTEM SET open_cursors=900 SCOPE=BOTH;
SQL> alter system set session_cached_cursors=0scope=spfile;
ü 重启数据库
Ø Benchmarksql 操作<和howTO.txt不同>:
在Oracle目标库创建了表空间和用户之后:
(1).runSQL.sh profile./sql.common/tableCreate.sql
(2).LoadSQL.shprofile
(3).runSQL.shprofile ./sql.common/indexCreate.sql
(4).runBenchmarkSQL.sh
1. 测试2c2g/oracle10g的测试结果
a. 单个仓库
[oracle@rhel651 run]$ ./runBenchmark.shmy_oracle1.properties
11:36:14,827 [main] INFO jTPCC : Term-00,
11:36:14,839 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
11:36:14,839 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
11:36:14,839 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
11:36:14,839 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
11:36:14,839 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
11:36:14,841 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
11:36:14,842 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
11:36:14,842 [main] INFO jTPCC : Term-00,
11:36:14,842 [main] INFO jTPCC : Term-00, db=oracle
11:36:14,842 [main] INFO jTPCC : Term-00,driver=oracle.jdbc.driver.OracleDriver
11:36:14,842 [main] INFO jTPCC : Term-00,conn=jdbc:oracle:thin:@192.168.137.29:1521:iwhm
11:36:14,842 [main] INFO jTPCC : Term-00, user=benchmarksql
11:36:14,842 [main] INFO jTPCC : Term-00,
11:36:14,842 [main] INFO jTPCC : Term-00, warehouses=1
11:36:14,842 [main] INFO jTPCC : Term-00, terminals=1
11:36:14,845 [main] INFO jTPCC : Term-00, runTxnsPerTerminal=10
11:36:14,845 [main] INFO jTPCC : Term-00, limitTxnsPerMin=300
11:36:14,845 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
11:36:14,845 [main] INFO jTPCC : Term-00,
11:36:14,846 [main] INFO jTPCC : Term-00, newOrderWeight=45
11:36:14,846 [main] INFO jTPCC : Term-00, paymentWeight=43
11:36:14,846 [main] INFO jTPCC : Term-00, orderStatusWeight=4
11:36:14,846 [main] INFO jTPCC : Term-00, deliveryWeight=4
11:36:14,846 [main] INFO jTPCC : Term-00, stockLevelWeight=4
11:36:14,846 [main] INFO jTPCC : Term-00,
11:36:14,847 [main] INFO jTPCC : Term-00,resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
11:36:14,847 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
11:36:14,847 [main] INFO jTPCC : Term-00,
11:36:15,028 [main] INFO jTPCC : Term-00, copiedmy_oracle1.properties to my_result_2016-09-18_113615/run.properties
11:36:15,028 [main] INFO jTPCC : Term-00, createdmy_result_2016-09-18_113615/data/runInfo.csv for runID 2
11:36:15,028 [main] INFO jTPCC : Term-00, writing per transactionresults to my_result_2016-09-18_113615/data/result.csv
11:36:15,029 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
11:36:15,029 [main] INFO jTPCC : Term-00, osCollectorInterval=1
11:36:15,029 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
11:36:15,030 [main] INFO jTPCC : Term-00, osCollectorDevices=net_eth0blk_sda
11:36:15,081 [main] INFO jTPCC : Term-00,
Traceback (most recent call last):
File "<stdin>", line 299, in <module>
File "<stdin>", line 62, in main
File "<stdin>", line 166, in initSystemUsage
Exception: cpu line in /proc/stat too short
11:36:15,108 [Thread-1] ERROR OSCollector$CollectData : OSCollector,unexpected EOF while reading from external helper process
11:36:48,066 [main] INFO jTPCC : Term-00, C value for C_LAST duringload: 247
11:36:48,066 [main] INFO jTPCC : Term-00, C value for C_LAST thisrun: 162
11:36:48,066 [main] INFO jTPCC :Term-00, Te11:36:50,354[Thread-2] INFO jTPCC : Term-00, nttpmTOTAL: 84 Memory Usage: 8MB / 44MB
11:36:50,355 [Thread-2] INFO jTPCC : Term-00,
11:36:50,355 [Thread-2] INFO jTPCC : Term-00, Measured tpmC (NewOrders) =148.66
11:36:50,355 [Thread-2] INFO jTPCC : Term-00, Measured tpmTOTAL = 327.05
11:36:50,355 [Thread-2] INFO jTPCC : Term-00, Session Start = 2016-09-18 11:36:48
11:36:50,356 [Thread-2] INFO jTPCC : Term-00, Session End = 2016-09-18 11:36:50
11:36:50,356 [Thread-2] INFO jTPCC : Term-00, Transaction Count = 10
b. 多仓库,10个仓库20个terminals:
按照每个数据仓库大小为80M,查看当前的表空间大小,使用10个测试。
TABLESPACE_NAME TOTAL FREE USED RAT
--------------- ---------- -------------------- ----------
UNDOTBS1 25 11.9375 13.0625 52.25
SYSAUX 240 2 238 99.17
BENCHMARK 1000 890.0625 109.9375 10.99
USERS 92.5 92.0625 .4375 .47
SYSTEM 480 9.5625 470.4375 98.01
修改配置:10个仓库20个terminals:
[oracle@rhel651 run]$ ./runBenchmark.shmy_oracle10.properties
16:28:05,018 [main] INFO jTPCC : Term-00,
16:28:05,027 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:28:05,027 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
16:28:05,027 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:28:05,028 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
16:28:05,028 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
16:28:05,032 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
16:28:05,032 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:28:05,033 [main] INFO jTPCC : Term-00,
16:28:05,033 [main] INFO jTPCC : Term-00, db=oracle
16:28:05,033 [main] INFO jTPCC : Term-00,driver=oracle.jdbc.driver.OracleDriver
16:28:05,033 [main] INFO jTPCC : Term-00,conn=jdbc:oracle:thin:@192.168.137.29:1521:iwhm
16:28:05,033 [main] INFO jTPCC : Term-00, user=benchmarksql10
16:28:05,033 [main] INFO jTPCC : Term-00,
16:28:05,033 [main] INFO jTPCC : Term-00, warehouses=10
16:28:05,033 [main] INFO jTPCC : Term-00, terminals=20
16:28:05,036 [main] INFO jTPCC : Term-00, runTxnsPerTerminal=10
16:28:05,036 [main] INFO jTPCC : Term-00, limitTxnsPerMin=300
16:28:05,036 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
16:28:05,036 [main] INFO jTPCC : Term-00,
16:28:05,036 [main] INFO jTPCC : Term-00, newOrderWeight=45
16:28:05,036 [main] INFO jTPCC : Term-00, paymentWeight=43
16:28:05,037 [main] INFO jTPCC : Term-00, orderStatusWeight=4
16:28:05,037 [main] INFO jTPCC : Term-00, deliveryWeight=4
16:28:05,037 [main] INFO jTPCC : Term-00, stockLevelWeight=4
16:28:05,037 [main] INFO jTPCC : Term-00,
16:28:05,037 [main] INFO jTPCC : Term-00,resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
16:28:05,037 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
16:28:05,037 [main] INFO jTPCC : Term-00,
16:28:05,206 [main] INFO jTPCC : Term-00, copiedmy_oracle10.properties to my_result_2016-09-18_162805/run.properties
16:28:05,206 [main] INFO jTPCC : Term-00, createdmy_result_2016-09-18_162805/data/runInfo.csv for runID 4
16:28:05,206 [main] INFO jTPCC : Term-00, writing per transactionresults to my_result_2016-09-18_162805/data/result.csv
16:28:05,207 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
16:28:05,207 [main] INFO jTPCC : Term-00, osCollectorInterval=1
16:28:05,208 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
16:28:05,208 [main] INFO jTPCC : Term-00, osCollectorDevices=net_eth0blk_sda
16:28:05,227 [main] INFO jTPCC : Term-00,
Traceback (most recent call last):
File "<stdin>", line 299, in <module>
File "<stdin>", line 62, in main
File "<stdin>", line 166, in initSystemUsage
Exception: cpu line in /proc/stat too short
16:28:05,244 [Thread-1] ERROR OSCollector$CollectData : OSCollector,unexpected EOF while reading from external helper process
16:28:06,313 [main] INFO jTPCC : Term-00, C value for C_LAST duringload: 220
16:28:06,313 [main] INFO jTPCC : Term-00, C value for C_LAST thisrun: 107
16:28:06,313 [main] INFO jTPCC : Term-00, Term-00,Running Average tpmTOTAL: 3016:28:47,442 [Thread-19] INFO jTPCC : Term-00, 7MB / 80MB
16:28:47,443 [Thread-19] INFO jTPCC : Term-00,
16:28:47,443 [Thread-19] INFO jTPCC : Term-00, Measured tpmC (NewOrders) =142.04
16:28:47,444 [Thread-19] INFO jTPCC : Term-00, Measured tpmTOTAL = 300.54
16:28:47,445 [Thread-19] INFO jTPCC : Term-00, Session Start = 2016-09-18 16:28:07
16:28:47,445 [Thread-19] INFO jTPCC : Term-00, Session End = 2016-09-18 16:28:47
16:28:47,445 [Thread-19] INFO jTPCC : Term-00, Transaction Count = 200
c. 修改配置:10个仓库100个terminals:
数据库连接数不够用(默认150)ORA-00018: maximum number of sessions exceeded
改成300:alter system set processes=300 scope=spfile;
[oracle@rhel651 run]$ ./runBenchmark.shmy_oracle10.properties
16:44:21,573 [main] INFO jTPCC : Term-00,
16:44:21,582 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:44:21,584 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
16:44:21,584 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:44:21,584 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
16:44:21,584 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
16:44:21,586 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
16:44:21,586 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
16:44:21,586 [main] INFO jTPCC : Term-00,
16:44:21,587 [main] INFO jTPCC : Term-00, db=oracle
16:44:21,587 [main] INFO jTPCC : Term-00,driver=oracle.jdbc.driver.OracleDriver
16:44:21,587 [main] INFO jTPCC : Term-00,conn=jdbc:oracle:thin:@192.168.137.29:1521:iwhm
16:44:21,587 [main] INFO jTPCC : Term-00, user=benchmarksql10
16:44:21,587 [main] INFO jTPCC : Term-00,
16:44:21,587 [main] INFO jTPCC : Term-00, warehouses=10
16:44:21,587 [main] INFO jTPCC : Term-00, terminals=100
16:44:21,590 [main] INFO jTPCC : Term-00, runTxnsPerTerminal=10
16:44:21,590 [main] INFO jTPCC : Term-00, limitTxnsPerMin=300
16:44:21,590 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
16:44:21,590 [main] INFO jTPCC : Term-00,
16:44:21,590 [main] INFO jTPCC : Term-00, newOrderWeight=45
16:44:21,590 [main] INFO jTPCC : Term-00, paymentWeight=43
16:44:21,591 [main] INFO jTPCC : Term-00, orderStatusWeight=4
16:44:21,591 [main] INFO jTPCC : Term-00, deliveryWeight=4
16:44:21,591 [main] INFO jTPCC : Term-00, stockLevelWeight=4
16:44:21,591 [main] INFO jTPCC : Term-00,
16:44:21,591 [main] INFO jTPCC : Term-00,resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
16:44:21,591 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
16:44:21,591 [main] INFO jTPCC : Term-00,
16:44:21,759 [main] INFO jTPCC : Term-00, copiedmy_oracle10.properties to my_result_2016-09-18_164421/run.properties
16:44:21,759 [main] INFO jTPCC : Term-00, createdmy_result_2016-09-18_164421/data/runInfo.csv for runID 6
16:44:21,760 [main] INFO jTPCC : Term-00, writing per transactionresults to my_result_2016-09-18_164421/data/result.csv
16:44:21,761 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
16:44:21,761 [main] INFO jTPCC : Term-00, osCollectorInterval=1
16:44:21,761 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
16:44:21,761 [main] INFO jTPCC : Term-00, osCollectorDevices=net_eth0blk_sda
16:44:21,781 [main] INFO jTPCC : Term-00,
Traceback (most recent call last):
File "<stdin>", line 299, in <module>
File "<stdin>", line 62, in main
File "<stdin>", line 166, in initSystemUsage
Exception: cpu line in /proc/stat too short
16:44:21,803 [Thread-1] ERROR OSCollector$CollectData : OSCollector,unexpected EOF while reading from external helper process
16:44:22,840 [main] INFO jTPCC : Term-00, C value for C_LAST duringload: 220
16:44:22,840 [main] INFO jTPCC : Term-00, C value for C_LAST thisrun: 102 Term-00,Running Average tpmTOTA16:47:47,105 [Thread-89] INFO jTPCC : Term-00, ge: 112MB / 162MB 16:47:47,106 [Thread-89] INFO jTPCC : Term-00,
16:47:47,106 [Thread-89] INFO jTPCC : Term-00, Measured tpmC (NewOrders) =133.64
16:47:47,106 [Thread-89] INFO jTPCC : Term-00, Measured tpmTOTAL = 299.94
16:47:47,106 [Thread-89] INFO jTPCC : Term-00, Session Start = 2016-09-18 16:44:26
16:47:47,106 [Thread-89] INFO jTPCC : Term-00, Session End = 2016-09-18 16:47:47
16:47:47,106 [Thread-89] INFO jTPCC : Term-00, Transaction Count = 1000
d. 修改配置:50个仓库200个terminals:
因为200个terminals 是200个链接,直接报出错误,不能执行,后改成50也不能正常运行,最终修改为20.
20*80M = 1600M的表空间需求 ,这里按照文档应该是100M/warehouse
50个warehouse和50个terminal测试数据量生成:
neworder
45W
Order_line
15010354
运行一次benchmark:
neworder
45W +18
Order_line
15010626
使用持续时间来跑压力:
runTxnsPerTerminal=0
//To run for specified minutes-runTxnsPerTerminal must equal zero
runMins=10##跑10分钟
//Number of total transactions per minute
limitTxnsPerMin=0
09:53:07,030 [main] INFO jTPCC : Term-00,
09:53:07,033 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
09:53:07,033 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
09:53:07,034 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
09:53:07,034 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
09:53:07,034 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
09:53:07,036 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
09:53:07,036 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
09:53:07,036 [main] INFO jTPCC : Term-00,
09:53:07,036 [main] INFO jTPCC : Term-00, db=oracle
09:53:07,036 [main] INFO jTPCC : Term-00,driver=oracle.jdbc.driver.OracleDriver
09:53:07,036 [main] INFO jTPCC : Term-00,conn=jdbc:oracle:thin:@192.168.137.29:1521:iwhm
09:53:07,037 [main] INFO jTPCC : Term-00, user=benchmarksql10
09:53:07,037 [main] INFO jTPCC : Term-00,
09:53:07,037 [main] INFO jTPCC : Term-00, warehouses=50
09:53:07,037 [main] INFO jTPCC : Term-00, terminals=50
09:53:07,040 [main] INFO jTPCC : Term-00, runMins=10
09:53:07,040 [main] INFO jTPCC : Term-00, limitTxnsPerMin=0
09:53:07,040 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
09:53:07,040 [main] INFO jTPCC : Term-00,
09:53:07,040 [main] INFO jTPCC : Term-00, newOrderWeight=45
09:53:07,040 [main] INFO jTPCC : Term-00, paymentWeight=43
09:53:07,040 [main] INFO jTPCC : Term-00, orderStatusWeight=4
09:53:07,041 [main] INFO jTPCC : Term-00, deliveryWeight=4
09:53:07,041 [main] INFO jTPCC : Term-00, stockLevelWeight=4
09:53:07,041 [main] INFO jTPCC: Term-00,
09:53:07,041 [main] INFO jTPCC : Term-00,resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
09:53:07,041 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
09:53:07,041 [main] INFO jTPCC : Term-00,
09:53:07,467 [main] INFO jTPCC : Term-00, copiedmy_oracle20.properties to my_result_2016-09-20_095307/run.properties
09:53:07,467 [main] INFO jTPCC : Term-00, createdmy_result_2016-09-20_095307/data/runInfo.csv for runID 16
09:53:07,467 [main] INFO jTPCC : Term-00, writing per transactionresults to my_result_2016-09-20_095307/data/result.csv
09:53:07,468 [main] INFO jTPCC : Term-00,osCollectorScript=./misc/os_collector_linux.py
09:53:07,469 [main] INFO jTPCC : Term-00, osCollectorInterval=1
09:53:07,469 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
09:53:07,469 [main] INFO jTPCC : Term-00, osCollectorDevices=net_eth0blk_sda
09:53:07,480 [main] INFO jTPCC : Term-00,
Traceback (most recent call last):
File "<stdin>", line 299, in <module>
File "<stdin>", line 62, in main
File "<stdin>", line 166, in initSystemUsage
Exception: cpu line in /proc/stat too short
09:53:07,496 [Thread-1] ERROR OSCollector$CollectData : OSCollector,unexpected EOF while reading from external helper process
09:53:08,959 [main] INFO jTPCC : Term-00, C value for C_LAST duringload: 209
09:53:08,959 [main] INFO jTPCC : Term-00, C value for C_LAST thisrun: 125
09:53:08,960 [main] INFO jTPCC : Term-00, Term-00, Running AveragetpmTOTAL: 1.53 Current tpmTOTAL:564 Memory Usage: 53MB / 236MB Term-00, Running Average tpmTOTAL: 0.60 Current tpmTOTAL: 588 Memory Usage: 56MB / 236MB
Term-00, Runni12:12:16,777 [Thread-33] INFO jTPCC : Term-00, 0 Memory Usage: 58MB / 236MB
12:12:16,777 [Thread-33] INFO jTPCC : Term-00,
12:12:16,777 [Thread-33] INFO jTPCC : Term-00, Measured tpmC (NewOrders) =0.2
12:12:16,777 [Thread-33] INFO jTPCC : Term-00, Measured tpmTOTAL = 0.55
12:12:16,778 [Thread-33] INFO jTPCC : Term-00, Session Start = 2016-09-20 09:53:10
12:12:16,778 [Thread-33] INFO jTPCC : Term-00, Session End = 2016-09-20 12:12:16
12:12:16,778 [Thread-33] INFO jTPCC : Term-00, Transaction Count = 76
这个时候可以看到数据库主机的磁盘已经被打满。
还有一种情况是将链接数调整到了100,在造数的过程中,会出现连接被占满的情况。
Terminal 和 warehouse的值是10:1,在代码段里看到。
RAC环境:
[oracle@rhel651 run]$ ./runBenchmark.shmy_oracleRac.properties
09:23:44,326 [main] INFO jTPCC : Term-00,
09:23:44,453 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
09:23:44,454 [main] INFO jTPCC : Term-00, BenchmarkSQL v5.0
09:23:44,454 [main] INFO jTPCC : Term-00,+-------------------------------------------------------------+
09:23:44,454 [main] INFO jTPCC : Term-00, (c) 2003, Raul Barbosa
09:23:44,454 [main] INFO jTPCC : Term-00, (c) 2004-2016, Denis Lussier
09:23:44,456 [main] INFO jTPCC : Term-00, (c) 2016, Jan Wieck
09:23:44,456 [main] INFO jTPCC : Term-00, +-------------------------------------------------------------+
09:23:44,456 [main] INFO jTPCC : Term-00,
09:23:44,457 [main] INFO jTPCC : Term-00, db=oracle
09:23:44,457 [main] INFO jTPCC : Term-00,driver=oracle.jdbc.driver.OracleDriver
09:23:44,457 [main] INFO jTPCC : Term-00,conn=jdbc:oracle:thin:@192.168.137.132:1521/iwhm
09:23:44,457 [main] INFO jTPCC : Term-00, user=benchmarksql
09:23:44,457 [main] INFO jTPCC : Term-00,
09:23:44,457 [main] INFO jTPCC : Term-00, warehouses=20
09:23:44,458 [main] INFO jTPCC: Term-00, terminals=50
09:23:44,460 [main] INFO jTPCC : Term-00, runMins=10
09:23:44,460 [main] INFO jTPCC : Term-00, limitTxnsPerMin=0
09:23:44,460 [main] INFO jTPCC : Term-00, terminalWarehouseFixed=true
09:23:44,460 [main] INFO jTPCC : Term-00,
09:23:44,460 [main] INFO jTPCC : Term-00, newOrderWeight=45
09:23:44,460 [main] INFO jTPCC : Term-00, paymentWeight=43
09:23:44,461 [main] INFO jTPCC : Term-00, orderStatusWeight=4
09:23:44,461 [main] INFO jTPCC : Term-00, deliveryWeight=4
09:23:44,461 [main] INFO jTPCC : Term-00, stockLevelWeight=4
09:23:44,461 [main] INFO jTPCC : Term-00,
09:23:44,461 [main] INFO jTPCC : Term-00,resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
09:23:44,461 [main] INFO jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
09:23:44,461 [main] INFO jTPCC : Term-00,
09:23:44,734 [main] INFO jTPCC : Term-00, copiedmy_oracleRac.properties to my_result_2016-09-23_092344/run.properties
09:23:44,734 [main] INFO jTPCC : Term-00, created my_result_2016-09-23_092344/data/runInfo.csvfor runID 17
09:23:44,735 [main] INFO jTPCC : Term-00, writing per transactionresults to my_result_2016-09-23_092344/data/result.csv
09:23:44,736 [main] INFO jTPCC : Term-00, osCollectorScript=./misc/os_collector_linux.py
09:23:44,736 [main] INFO jTPCC : Term-00, osCollectorInterval=1
09:23:44,736 [main] INFO jTPCC : Term-00, osCollectorSSHAddr=null
09:23:44,736 [main] INFO jTPCC : Term-00, osCollectorDevices=net_eth0blk_sda
09:23:44,912 [main] INFO jTPCC : Term-00,
Traceback (most recent call last):
File "<stdin>", line 299, in <module>
File "<stdin>", line 62, in main
File "<stdin>", line 166, in initSystemUsage
Exception: cpu line in /proc/stat tooshort Term-00,Running Average tpmTOT09:35:01,256 [Thread-28] INFO jTPCC : Term-00, Usage: 97MB / 228MB 09:35:01,256 [Thread-28] INFO jTPCC : Term-00, 09:35:01,256 [Thread-28] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 523.68 09:35:01,257[Thread-28] INFO jTPCC : Term-00,Measured tpmTOTAL = 1174.01 09:35:01,257 [Thread-28] INFO jTPCC : Term-00, Session Start = 2016-09-23 09:24:25
09:35:01,257 [Thread-28] INFO jTPCC : Term-00, Session End = 2016-09-23 09:35:01
09:35:01,257 [Thread-28] INFO jTPCC : Term-00, Transaction Count = 12439
在同样性能指标的DISK环境下,RAC能达到500多,性能提高了将近5倍!!
测试结果:
TPCC值
用户数
warehouses
148.66
1
1
142.04
20
10
133.64
100
10
0.2
50
50
Awr:
Ø 生成awr
手动执行一个快照:
Exec dbms_workload_repository.create_snapshot; (这个要背出来哦,用的时候去翻手册,丢脸哦 J!)
创建一个AWR基线<本次测试不使用>
使用 AWR 基线进行性能比较分析
为性能度量设置什么样的阈值是合适的?要检测哪些内容?如果希望性能量度值表示服务器接近其容量限制的程度,则使用绝对值是正确的选择。但如果要了解今天的性能是否与上周、上月此时的性能不同,则必须将当前性能与基线进行比较。
为性能度量设置什么样的阈值是合适的?要检测哪些内容?如果希望性能量度值表示服务器接近其容量限制的程度,则使用绝对值是正确的选择。但如果要了解今天的性能是否与上周、上月此时的性能不同,则必须将当前性能与基线进行比较。
Exec DBMS_WORKLOAD_REPOSITORY.CREATE_BASELINE(start_snap_id,end_snap_id ,baseline_name);
@?/rdbms/admin/awrddrpt AWR比对报告
@?/rdbms/admin/awrgrpt RAC 全局AWR
自动生成AWR HTML报告:
http://www.oracle-base.com/dba/10g/generate_multiple_awr_reports.sql
Ø 查看awr
Selectsnap_id,dbid,BEGIN_INTERVAL_TIME,END_INTERVAL_TIME,SNAP_LEVEL fromdba_hist_snapshot order by 3;
495 - 497
Ø 查看报告
在执行之前查看当前的snapshot编号并记录值,在执行完成之后记录最后执行的编号,之后执行awr区间的报告;
参考AWR中的Instance ActivityStatistics 环节
IOPS = “physical reads total I/O requests”+ “physical writes total I/Orequests”
MBytes/s = “physical reads total bytes” + physical writes totalbytes”
MBytes/s = “physical reads total bytes” + physical writes totalbytes”
physical read total IO requests 3,272,436 455.48 34.52
physical write IO requests 314,647 43.79 3.32
physical write IO requests 314,647 43.79 3.32
IOPS = “physical reads total I/O requests” + “physical writes totalI/Orequests” = 455+43 = 498
physical read total bytes
3,218,786,182,144 448,007,955.58 33,956,306.25
physical write total bytes
physical write total bytes
72,372,139,008 10,073,143.17 763,483.62
MBytes/s= 448,007,955 + 10,073,143 = 458081098bytes= 436 MB/s
大致计算其 IOPS 为 498 而 吞吐量为 436MB/s
实例:
physical read total IO requests
97,973
59.29
16.24
physical write IO requests
261,015
157.89
43.26
IOPS = 59.29 + 157.89 = 217.27
physical read total bytes
2,356,165,632
1,426,327.43
390,546.27
physical write bytes
3,832,233,984
2,318,876.61
635,212.00
Mbytes/s = 1426327.43 + 2318876.61 = 3.6Mbytes/s
=〉terminals和 limitTxnsPerMin参数解释
The configuration setting "terminals" is the number of database connections, BenchmarkSQL will use in parallel. Like many benchmarks of its kind, BenchmarkSQL is currently implementing an agglutenation of what is defined in the TPC-C Specs as a Terminal, with what should be a worker thread with a database connection in the SUT.
The configuration setting "limitTxnsPerMin" controls a transaction rate throttling mechanism. TPC-C defines an OLTP test, so the benchmark driver should not behave like a set of punch card readers but rather act more like (many) human beings. The rate throttling isn't exactly what TPC-C specifies, but is an OK approximation for a simple implementation. To get a driver to really behave as specified in TPC-C is difficult.
说白了,terminals参数就是并发啦。
---------------------
作者:大慧说
来源:CSDN
原文:https://blog.csdn.net/nirvana52/article/details/52668591
版权声明:本文为博主原创文章,转载请附上博文链接!
作者:大慧说
来源:CSDN
原文:https://blog.csdn.net/nirvana52/article/details/52668591
版权声明:本文为博主原创文章,转载请附上博文链接!