优化tez引擎-资源限制

优化tez引擎-资源限制,第1张

优化tez引擎-资源限制
1. 参数
set tez.am.resource.memory.mb=4096;                                     // 与yarn.scheduler.minimum-allocate-mb YARN最小容器大小相同
set tez.runtime.io.sort.mb=1638;                                        // hive.tez.container.size的40%
set hive.auto.convert.join.noconditionaltask.size=1431655765;           // hive.tez.container.size的1/3
set tez.runtime.unordered.output.buffer.size-mb=409;                    // hive.tez.container.size的10%
set tez.am.container.reuse.enabled=true;                                // Container重用开关,打开提高效率
set tez.grouping.split-count=139;                                       // 分片根据数据量大小定义
set hive.tez.container.size=4096;                                       // 每个容器设置4G大小


2. 说明:
任务核心使用=分片数   
任务内存总使用=分片数*容器大小

tez.runtime.io.sort.mb是当需要对输出进行排序的内存。
tez.runtime.unordered.output.buffer.size-mb是输出不需要排序的内存。
hive.auto.convert.join.noconditionaltask.size是一个非常重要的参数,用于设置执行Map join时的内存大小。
tez.am.resource.memory.mb设置为与yarn.scheduler.minimum-allocate-mb YARN最小容器大小相同。 
hive.tez.container.size设置为与yarn.scheduler.minimum-allocation-mb大小相同或小倍数(1或2倍),但不能超过yarn.scheduler.maximum-allocation-mb。
tez.runtime.io.sort.mb为hive.tez.container.size的40%,不应该超过2gb。
hive.auto.convert.join.noconditionaltask.size为hive.tez.container.size的1/3
tez.runtime.unordered.output.buffer.size-mb为hive.tez.container.size的10%


3. 优化方法:
1) 调集群参数
2) 拆步骤, 使用临时表减少算力
3) 优化语法
4) 加资源


4. 例子:
insert overwrite table wh.xxx_211102
select * from wh.xxx;
(测试结果: 根据第一步的参数: 450G数据量, 消耗160核心,消耗内存600多G。)

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5154141.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-18
下一篇 2022-11-18

发表评论

登录后才能评论

评论列表(0条)

保存