本文是基于 TPC-DS 的 Hive 性能测试,压测工具为开源的 hive-testbench。
1 背景
采用hive-testbench的hive13分支代码进行编译压测.
2 环境准备
下载hive-testbench:
2.1 编译
2.2 生成数据集
tips:
需要修改hive环境
需要修改初始化参数(有的参数因为版本问题不支持)
3 测试用例
用例目录
1 | cd sample-queries-tpcds |
3.1 语法校验
3.1.1 生成explain语句:
1 | sh 1_all_explain_builder.sh |
3.1.2 执行explian进行语法校验:
1 | sh 2_all_explain_run.sh |
3.2 参数调整
去除已经不生效或不支持的参数
设置reduce数量为100;开启严格模式,取消查询结果限制等
1 | set mapred.reduce.tasks=100; |
3.3 排除的用例
1 | -- 1个map 运行长时间不结束 |
3.4 修改的用例
1 | query24.sql |
3.5 有效用例
原始case64个; 经explain校验语法等,排除6个(执行时间太长,属于极端case);修改语法2个;最终有效case58个;
1 | query12.sql |
4 测试步骤
4.1 准备数据
1 | nohup sh hive-testbench-start.sh 2 hdfs://nsfed/user/hadoop/tpcds prepare > my-tpcds-setup-prepare-2.log 2>&1 & |
Done
4.2 数据检查
1 | nohup sh hive-testbench-start.sh 2 hdfs://nsfed/user/hadoop/tpcds check > my-tpcds-setup-check-2.log 2>&1 & |
4.3 执行压测
1 | nohup sh hive-testbench-start.sh 2 hdfs://nsfed/user/hadoop/tpcds runbench > my-tpcds-setup-runbench-2.log 2>&1 & |
5 结果分析
5.1 2G
5.1.1 数据集概览
各表数据量
table_name | count |
---|---|
call_center | 8 |
catalog_page | 11718 |
catalog_returns | 288491 |
catalog_sales | 2865785 |
customer | 144000 |
customer_address | 72000 |
customer_demographics | 1920800 |
date_dim | 73049 |
household_demographics | 7200 |
inventory | 16966305 |
item | 26000 |
promotion | 322 |
reason | 36 |
ship_mode | 0 |
store | 22 |
store_returns | 555309 |
store_sales | 5501397 |
time_dim | 86400 |
warehouse | 5 |
web_page | 74 |
web_returns | 137272 |
web_sales | 1438883 |
web_site | 30 |
文件各目录大小
1 | 2.1 G hdfs://nsfed/user/hadoop/tpcds/2 |
文件副本详情
1 | Status: HEALTHY |
5.2 5G
5.2.1 数据集概览
各表数据量
table_name | count |
---|---|
call_center | 14 |
catalog_page | 11718 |
catalog_returns | 720174 |
catalog_sales | 7163635 |
customer | 277000 |
catalog_page | 11718 |
catalog_returns | 720174 |
catalog_sales | 7163635 |
customer | 277000 |
customer_address | 138000 |
customer_demographics | 1920800 |
date_dim | 73049 |
household_demographics | 7200 |
income_band | 20 |
inventory | 49329000 |
item | 54000 |
promotion | 388 |
reason | 39 | |
ship_mode | 0 |
store | 52 |
store_returns | 1387580 |
store_sales | 13751414 |
time_dim | 86400 |
warehouse | 7 |
文件各目录大小
1 | 5.3 G hdfs://nsfed/user/hadoop/tpcds/5 |
##### 文件副本情况
1 | Status: HEALTHY |
有了测试集,便可以运行压测case,来分析性能。这里鉴于数据安全考虑,就不贴测试结果了。l
本文作者:
Jeff.R
本文链接: https://stefanxiepj.github.io/archives/4e28d479.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!
本文链接: https://stefanxiepj.github.io/archives/4e28d479.html
版权声明: 本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。转载请注明出处!
![知识共享许可协议](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)