我们采用亚马逊emr构建的集群,用hive查询的时候报错,FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask,查看了下面的参数,挺有帮助的 我是设置了这个参数set hive.tez.auto.reducer.parallelism=true;

Tez内存优化

1、AM、Container大小设置

tez.am.resource.memory.mb

参数说明:Set tez.am.resource.memory.mb tobe the same as yarn.scheduler.minimum-allocation-mb the YARNminimum container size.

hive.tez.container.size

参数说明:Set hive.tez.container.size to be the same as or a small multiple(1 or 2 times that) of YARN container size yarn.scheduler.minimum-allocation-mb but NEVER more than yarn.scheduler.maximum-allocation-mb.

2、AM、Container JVM参数设置

tez.am.launch.cmd-opts

默认值:80%*tez.am.resource.memory.mb

参数说明:一般不需要调整

hive.tez.java.ops

    默认值:80%*hive.tez.container.size

参数说明:Hortonworks建议“–server –Djava.net.preferIPv4Stack=true–XX:NewRatio=8 –XX:+UseNUMA –XX:UseG1G”

tez.container.max.java.heap.fraction

默认值:0.8

参数说明:task\AM占用JVM Xmx的比例,该参数建议调整,需根据具体业务情况修改;

3、Hive内存Map Join参数设置

tez.runtime.io.sort.mb

默认值:100

参数说明:输出排序需要的内存大小。建议值:40%*hive.tez.container.size,一般不超过2G;

hive.auto.convert.join.noconditionaltask

默认值:true

参数说明:是否将多个mapjoin合并为一个,使用默认值

hive.auto.convert.join.noconditionaltask.size

默认值:

参数说明:多个mapjoin转换为1个时,所有小表的文件大小总和的最大值,这个值只是限制输入的表文件的大小,并不代表实际mapjoin时hashtable的大小。 建议值:1/3* hive.tez.container.size

tez.runtime.unordered.output.buffer.size-mb

默认值:100

参数说明:Size of the buffer to use if not writing directly to disk.。 建议值:10%* hive.tez.container.size

4、Container重用设置

tez.am.container.reuse.enabled

默认值:true

参数说明:Container重用开关

Mapper/Reducer优化

1、Mapper数设置

tez.grouping.min-size

默认值:50*1024*1024

参数说明:Lower bound on thesize (in bytes) of a grouped split, to avoid generating too many small splits.

tez.grouping.max-size

默认值:1024*1024*1024

参数说明:Upper bound on thesize (in bytes) of a grouped split, to avoid generating excessively largesplits.

;

2、Reducer数设置

hive.tez.auto.reducer.parallelism

默认值:false

参数说明:Turn on Tez' autoreducer parallelism feature. When enabled, Hive will still estimate data sizesand set parallelism estimates. Tez will sample source vertices' output sizesand adjust the estimates at runtime as necessary.

建议设置为true.

hive.tex.min.partition.factor

默认值:0.25

参数说明:When auto reducerparallelism is enabled this factor will be used to put a lower limit to thenumber of reducers that Tez specifies.

hive.tez.max.partition.factor

默认值:2.0

参数说明:When auto reducerparallelism is enabled this factor will be used to over-partition data inshuffle edges.

hive.exec.reducers.bytes.per.reducer

默认值:256,000,000

参数说明:Sizeper reducer. The default in Hive 0.14.0 and earlier is 1 GB, that is, if theinput size is 10 GB then 10 reducers will be used. In Hive 0.14.0 and later thedefault is 256 MB, that is, if the input size is 1 GB then 4 reducers willbe used.

以下公式确认Reducer个数:

Max(1, Min(hive.exec.reducers.max [1009], ReducerStage estimate/hive.exec.reducers.bytes.per.reducer))x hive.tez.max.partition.factor [2]

3、Shuffle参数设置

tez.shuffle-vertex-manager.min-src-fraction

默认值:0.25

参数说明:thefraction of source tasks which should complete before tasks for the currentvertex are scheduled.

tez.shuffle-vertex-manager.max-src-fraction

默认值:0.75

参数说明:oncethis fraction of source tasks have completed, all tasks on the current vertexcan be scheduled. Number of tasks ready for scheduling on the current vertexscales linearly between min-fraction and max-fraction.

 

例子:

hive.exec.reducers.bytes.per.reducer=1073741824;// 1gb

tez.shuffle-vertex-manager.min-src-fraction=0.25;

tez.shuffle-vertex-manager.max-src-fraction=0.75;

This indicates thatthe decision will be made between 25% of mappers finishing and 75% of mappersfinishing, provided there's at least 1Gb of data being output (i.e if 25% ofmappers don't send 1Gb of data, we will wait till at least 1Gb is sent out).

骚年希望能帮助你

hive 调优(三)tez优化的更多相关文章

  1. 【Hive】Hive笔记:Hive调优总结——数据倾斜,join表连接优化

    数据倾斜即为数据在节点上分布不均,是常见的优化过程中常见的需要解决的问题.常见的Hive调优的方法:列剪裁.Map Join操作. Group By操作.合并小文件. 一.表现 1.任务进度长度为99 ...

  2. (转)hive调优(1) coding调优

    hive 调优(一)coding调优 本人认为hive是很好的工具,目前支持mr,tez,spark执行引擎,有些大公司原来封装的sparksql,开发py脚本,但是目前hive支持spark引擎(不 ...

  3. Hive调优相关

    前言 Hive是由Facebook 开源用于解决海量结构化日志的数据统计,是基于Hadoop 的一个数据仓库工具,可以将结构化的数据文件映射为一张表,并提供类 SQL查询功能. 在资源有限的情况下,提 ...

  4. 【Hadoop离线基础总结】Hive调优手段

    Hive调优手段 最常用的调优手段 Fetch抓取 MapJoin 分区裁剪 列裁剪 控制map个数以及reduce个数 JVM重用 数据压缩 Fetch的抓取 出现原因 Hive中对某些情况的查询不 ...

  5. 【Hive六】Hive调优小结

    Hive调优 Hive调优 Fetch抓取 本地模式 表的优化 小表.大表Join 大表Join大表 MapJoin Group By Count(Distinct) 去重统计 行列过滤 动态分区调整 ...

  6. Hive调优笔记

    Hive调优 先记录了这么多,日后如果有遇到,再补充. fetch模式 <property> <name>hive.fetch.task.conversion</name ...

  7. (转) hive调优(2)

    hive 调优(二)参数调优汇总 在hive调优(一) 中说了一些常见的调优,但是觉得参数涉及不多,补充如下 1.设置合理solt数 mapred.tasktracker.map.tasks.maxi ...

  8. hive 调优(二)参数调优汇总

    在hive调优(一) 中说了一些常见的调优,但是觉得参数涉及不多,补充如下 1.设置合理solt数 mapred.tasktracker.map.tasks.maximum 每个tasktracker ...

  9. Spark调优,性能优化

    Spark调优,性能优化 1.使用reduceByKey/aggregateByKey替代groupByKey 2.使用mapPartitions替代普通map 3.使用foreachPartitio ...

  10. Java性能优化,操作系统内核性能调优,JYM优化,Tomcat调优

    文章目录 Java性能优化 尽量在合适的场合使用单例 尽量避免随意使用静态变量 尽量避免过多过常地创建Java对象 尽量使用final修饰符 尽量使用局部变量 尽量处理好包装类型和基本类型两者的使用场 ...

随机推荐

  1. 首探:Ruby on Rails 简单了解

    一. 安装 Ruby安装:https://ruby-china.org/wiki/rvm-guide 注:安装了RVM和Gem后 安装rails: gem install rails -v 5.1.4 ...

  2. 纯H5 AJAX文件上传加进度条功能

    上传代码js部分 //包上传 $('.up_apk').change(function () { var obj = $(this); var form_data = new FormData(); ...

  3. Java web验证码——kaptcha的使用

    一.配置kaptcha的jar包 pom.xml配置: <-- 目前只有2.3.2版本--> <!-- https://mvnrepository.com/artifact/com. ...

  4. loj 6043「雅礼集训 2017 Day7」蛐蛐国的修墙方案

    loj 爆搜? 爆搜! 先分析一下,因为我们给出的是一个排列,然后让\(i\)给\(p_i\)连边,那么我们一定会得到若干个环,最后要使得所有点度数为1,也就是这些环有完备匹配,那么最后一定全是偶环. ...

  5. 改变font-weight的数值,样式并不会改变的原因

    通常情况下,一个特定的字体仅会包含少数的可用字重.若所指定的字重不存在直接匹配,则会通过字体匹配算法规则匹配使用邻近的可用字重.这也就是为什么我们有时候使用特定字重时没有“生效”,看起来跟其它字重差不 ...

  6. vue iview面包屑

    简单看一下vue,iview的面包屑怎么写呢? 简单的思路:1.获取到路由记录$route.matched 2.渲染 效果: 一.$route.matched 官网地址:https://router. ...

  7. java并发编程:锁的相关概念介绍

    理解同步,最好先把java中锁相关的概念弄清楚,有助于我们更好的去理解.学习同步.java语言中与锁有关的几个概念主要是:可重入锁.读写锁.可中断锁.公平锁 一.可重入锁 synchronized和R ...

  8. Linux配置iSCSI存储

    1.基础知识 1.1 存储相关     直接存储(DAS):例如本机上的磁盘,就是属于直接存储设备.     存储区域网络(SAN):来自网络内的其他存储设备提供的磁盘.Iscsi就是属于该方式.   ...

  9. 可靠的TCP连接为何是三次握手和四次挥手

    首先,咱们先来熟悉下经典的tcp/ip模型. tcp/ip 模型为了方便使用,将osi七层模型划分成了四层,分别为网络接口层,网络层,传输层,应用层. 他们作用分别为: 1)网络接口层:主要作用是将i ...

  10. 15 Zabbix4.4.1系统告警“sda: Disk read/write request response are too high”

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 Zabbix4.4.1系统告警“sda: Disk read/write request resp ...