近期客户上线了一套DB2 数据库,让我们提供下数据库的压测方案,接到要求后开始找合适的压测工具,因为DB2数据库的特殊性,关于DB2数据库的压测工具并不多,上网看了下,对于数据库的压测工具有以下几种工具:
通过对比后,决定使用HammerDB,为最终工具
下面就介绍下使用HammerDB对DB2进行压测的使用方法
下载完成后进行安装,一直下一步就可以了
安装完成后打开界面如下
选择安装新产品
然后一直下一步,到完成安装。
▼▼▼
[db2inst1@ ~]$ db2 create database tpcc pagesize 8 k
DB20000I The CREATE DATABASE command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using PCKCACHESZ 1631072
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using LOGFILSIZ 1048572
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using LOGPRIMARY 25
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using LOGSECOND 5
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using LOGBUFSZ 17264
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using MINCOMMIT 1
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using NUM_IOSERVERS AUTOMATIC
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using DFT_PREFETCH_SZ AUTOMATIC
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using LOCKTIMEOUT 15
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$ db2 update db cfg for tpcc using SOFTMAX 2500
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.
[db2inst1@ ~]$
[db2inst1@ ~]$ db2 connect to tpcc
Database Connection Information
Database server = DB2/LINUXX8664 10.5.5
SQL authorization ID = DB2INST1
Local database alias = TPCC
[db2inst1@ ~]$ db2 create bufferpool C_BP immediate size 2500000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace C_TS pagesize 8k managed by automatic storage bufferpool C_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool D_BP immediate size 500000 pagesize 4k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace D_TS pagesize 4k managed by automatic storage bufferpool D_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool W_BP immediate size 500000 pagesize 4k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace W_TS pagesize 4k managed by automatic storage bufferpool W_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool I_BP immediate size 500000 pagesize 4k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace I_TS pagesize 4k managed by automatic storage bufferpool I_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool H_BP immediate size 2000000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace H_TS pagesize 8k managed by automatic storage bufferpool H_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool S_BP immediate size 2000000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace S_TS pagesize 8k managed by automatic storage bufferpool S_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool NO_BP immediate size 3000000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace NO_TS pagesize 8k managed by automatic storage bufferpool NO_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool OR_BP immediate size 3000000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace OR_TS pagesize 8k managed by automatic storage bufferpool OR_BP
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create bufferpool OL_BP immediate size 5000000 pagesize 8k
DB20000I The SQL command completed successfully.
[db2inst1@ ~]$ db2 create large tablespace OL_TS pagesize 8k managed by automatic storage bufferpool OL_BP
DB20000I The SQL command completed successfully.
▼▼▼
D:Program FilesIBMSQLLIBBIN>db2 catalog tcpip node tpcc remote 192.168.100.101 server 50000
DB20000I CATALOG TCPIP NODE 命令成功完成。
DB21056W 直到刷新目录高速缓存之后,目录更改才生效。
D:Program FilesIBMSQLLIBBIN> db2 catalog db tpcc as tpcc at node tpcc
DB20000I CATALOG DATABASE 命令成功完成。
DB21056W 直到刷新目录高速缓存之后,目录更改才生效。
D:Program FilesIBMSQLLIBBIN>db2 terminate
DB20000I TERMINATE 命令成功完成。
D:Program FilesIBMSQLLIBBIN>db2 connect to tpcc user db2inst1 using db2inst1
数据库连接信息
数据库服务器 = DB2/LINUXX8664 10.5.11
SQL 授权标识 = DB2INST1
本地数据库别名 = TPCC
然后点击Build 创建测试用的用户
点击Load 进行脚本创建
点击RUN进行测试
在测试的时候点击start transaction couter
可以查看到HammerDB提供的监控指标:吞吐量,单位为TPM(每分钟事务数)。
以上就是使用HammerDB工具DB2数据库进行测试的使用方法,如有对测试工具有其他的问题的欢迎沟通。
更多精彩干货分享
点击下方名片关注
IT那活儿
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129929.html
摘要:下面基于,带着大家看一下中如何配置多数据源。注意版本不一致导致的一些小问题。配置配置两个数据源数据库和数据库注意事项在配置数据源的过程中主要是写成和。五启动类此注解表示启动类这样基于的多数据源配置就已经完成了,两个数据库都可以被访问了。 在上一篇文章《优雅整合 SpringBoot+Mybatis ,可能是你见过最详细的一篇》中,带着大家整合了 SpringBoot 和 Mybatis...
摘要:性能压测工具及其调优工具使用使用使用简介在日常的开发中,的性能显得尤为重要,一个程序的好坏主要就是性能来决定的。工具主要就是用于对程序进行压力测试的一种有有力工具。 ...
摘要:主要介绍了美团智能支付业务在稳定性方向遇到的挑战,并重点介绍在稳定性测试中的一些方法与实践。其中,智能支付作为新扩展的业务场景,去年也成为了美团增速最快的业务之一。 本文根据美团高级测试开发工程师勋伟在美团第43期技术沙龙美团金融千万级交易系统质量保障之路的演讲整理而成。主要介绍了美团智能支付业务在稳定性方向遇到的挑战,并重点介绍QA在稳定性测试中的一些方法与实践。 背景 美团支付承载...
阅读 1249·2023-01-11 13:20
阅读 1557·2023-01-11 13:20
阅读 1011·2023-01-11 13:20
阅读 1680·2023-01-11 13:20
阅读 3971·2023-01-11 13:20
阅读 2519·2023-01-11 13:20
阅读 1310·2023-01-11 13:20
阅读 3486·2023-01-11 13:20