ODPS数据倾斜导致的问题

前面转自:https://help.aliyun.com/knowledge_detail/43141.html#MaxCompute的MapReduce报错FAILED: ODPS-0123144: Fuxi job failed - WorkerRestart

 

MaxCompute的MapReduce报错FAILED: ODPS-0123144: Fuxi job failed - WorkerRestart

问题现象


执行MapReduce或者UDF的时候,有如下报错:

 

  1. FAILED: ODPS-0123144: Fuxi job failed - WorkerRestart errCode:252,errMsg:kInstanceMonitorTimeout, usually caused by bad udf performance.
  2. Exception in thread "main" com.aliyun.odps.OdpsException: ODPS-0123144: Fuxi job failed - WorkerRestarterrCode:252,errMsg:kInstanceMonitorTimeout, usually caused by bad udf performance.

 

问题原因


这个问题是由于集群的Slave节点在计算的过程中出现了超时了,导致Master节点认为子节点死掉的报错。目前的超时时间为10分钟,暂时不支持用户配置。这个报错比较常见的原因是Reduce里做了大循环,比如是存在长尾数据或者做笛卡尔积。用户需要尽量减少这种大循环的情况。对于长尾数据,可以考虑拿出来单独处理。或者用户可以手工发心跳,调用context.progress(); 但是这个有性能问题,不适合调用太频繁。


案例分析

先用group by查看数据倾斜状况

例如  select devmac,merchantid,isencrypt,count(1) as num from wi_passer_flow_log where dt = '2016-08-02' group by  devmac,merchantid,isencrypt  order by num desc limit 50; 

可以看到客流统计日志表2016-08-02分区,存在严重的数据倾斜–最多一天之中一台设备到达|认证|离开一家店铺的次数达到了45w条


解决

修改map或者reduce程序,过滤掉脏数据。





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值