关于BenchMarkSQL
TPC-C 是一种衡量 OLTP 系统性能和可伸缩性的基准测试项目。它由一系列的 OLTP 工作流组成,包括查询,更新及队列式小批量事务在内的广泛数据库功能。它模拟了一个典型的 OLTP 应用环境中的活动,这些活动由一系列复杂的事务组成。TPC-C 工作流应该具备以下特性:
- 适当复杂的 OLTP 事务
- 在线和延迟事务执行模型
- 多用户
- 适当的系统和应用执行时间
- 大量的磁盘输入和输出
- 事务完整性(ACID)
- 随机的数据访问
- 数据库由各种大小,属性和关系的表组成。
BenchmarkSQL是对OLTP数据库主流测试标准TPC-C的开源实现。目前最新版本为V5.0。
测试环境
达梦8,centos7.9,benchmarksql5.0。服务器是虚拟机中的2.4G单核CPU+8G内存配置。
测试流程
1.配置执行环境
benchmarksql默认并没有直接支持达梦。
首先我们应该将dm8的jdbc驱动放到benchmarksql的lib目录下。然后需要在run目录下配置属性文件props.dm.
以下是我配置的props.dm
db=dm
driver=dm.jdbc.driver.DmDriver
conn=jdbc:dm://127.0.0.1:5236
user=SYSDBA
password=SYSDBAwarehouses=10
loadWorkers=2terminals=10
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
runMins=3
//Number of total transactions per minute
limitTxnsPerMin=0//Set to true to run in 4.x compatible mode. Set to false to use the
//entire configured database evenly.
terminalWarehouseFixed=true//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
// Directory name to create for collecting detailed result data.
// Comment this out to suppress.
resultDirectory=my_result_%tY-%tm-%td_%tH%tM%tS
osCollectorScript=./misc/os_collector_linux.py
osCollectorInterval=1
//osCollectorSSHAddr=SYSDBA@192.168.216.128
osCollectorDevices=net_enslo blk_sda3
其中参数:
warehouses是被测仓库数;
loadworkers是数据装载并发数;
terminals是数据库连接并发数;
runMins是测试时间(分钟)。
2.执行建表工具
./runSQL.sh props.dm tableCreates
3.执行数据装载工具
./runLoader.sh props.dm
3.创建索引
./runSQL.sh props.dm indexCreates
4.执行测试工具
./runBenchmark.sh props.dm
5.清理
测试完之后应该清理数据。进入run目录,在终端下执行
./runSQL.sh props.dm indexDrops
./runSQL.sh props.dm tableTruncates
./runSQL.sh props.dm tableDrops
6.测试结果
测试完之后结果会保存在run文件夹下的“my_result_时间”文件夹中
至此已完成基本的benchmarksql测试。
更多参考内容请访问达梦云适配中心