首页 技术 正文
技术 2022年11月23日
0 收藏 719 点赞 4,343 浏览 1940 个字

首先看没有map join的第2任务:

时间线如下

Spark大型电商项目实战-及其改良(2) RDD优化效果不稳定的真正原因

接着是对应id的算子计算时间表

Stage Id Description Submitted Duration Tasks: Succeeded/Total Input Output Shuffle Read <!– Place the shuffle write tooltip on the left (rather than the default position
of on top) because the shuffle write column is the last column on the right side and
the tooltip is wider than the column, so it doesn’t fit on top. –> Shuffle Write
13 collect at AreaTop3ProductRDD.java:353 +details 2019/01/29 11:19:02 59 ms 41/41

  

    235.3 KB  
12 mapToPair at AreaTop3ProductRDD.java:259 +details 2019/01/29 11:19:02 0.1 s 41/41

  

    383.2 KB 235.3 KB
11 mapToPair at AreaTop3ProductRDD.java:251 +details 2019/01/29 11:19:02 95 ms 41/41

  

    99.3 KB 246.2 KB
9 mapToPair at AreaTop3ProductRDD.java:230 +details 2019/01/29 11:19:01 0.5 s 41/41

  

    767.7 KB 99.3 KB
8 mapToPair at AreaTop3ProductRDD.java:128 +details 2019/01/29 11:19:01 0.5 s 41/41

  

      752.0 KB
7 mapToPair at AreaTop3ProductRDD.java:164 +details 2019/01/29 11:19:01 0.3 s 1/1

  

      15.7 KB
10 mapToPair at AreaTop3ProductRDD.java:248 +details 2019/01/29 11:19:01 0.5 s 41/41

  

      137.0 KB

城市区域表(对应id 10)和商品列表(对应id 7)的数据量比较小,但在集群中的运行时间还是比较长的

不过因为是并行化运行,点击记录(对应id 8)的处理很快就完毕

并且id 9(把数据转换为key是区域+商品id,value是城市信息的组合)的运行时间也不长

在程序只是简单转换为RDD的情况下也能发挥优化效果

相比上述程序,speedUp版程序执行效率没有多大提升。

时间线如下

Spark大型电商项目实战-及其改良(2) RDD优化效果不稳定的真正原因

时间表如下

Stage Id Description Submitted Duration Tasks: Succeeded/Total Input Output Shuffle Read <!– Place the shuffle write tooltip on the left (rather than the default position
of on top) because the shuffle write column is the last column on the right side and
the tooltip is wider than the column, so it doesn’t fit on top. –> Shuffle Write
17 collect at AreaTop3ProductRDDSpeedUp.java:371 +details 2019/01/29 11:19:03 53 ms 41/41

  

    246.7 KB  
16 mapToPair at AreaTop3ProductRDDSpeedUp.java:284 +details 2019/01/29 11:19:03 0.1 s 41/41

  

    475.6 KB 246.7 KB
15 mapToPair at AreaTop3ProductRDDSpeedUp.java:218 +details 2019/01/29 11:19:02 0.6 s 41/41

  

      475.9 KB

把城市区域表和商品列表转换为broadcast大变量,给id 15的算子进行map join的做法反而增加了driver的计算量,并且由于被统一到一个算子中运算,丢失了并行化的优势

像12月那次的调试,还出现了优化后运行时间倒挂的情况,就是id 15的运行时间拖慢了(map join用的HashMap,不知道是不是这个原因)

算上job id 2的运行时间(才28ms…)speedUp的运行时间比不带speedUp的短了20%

另外由于只有3台,数据倾斜造成的运算拖慢很难表现出来,此处就不演示均衡数据优化了

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,999
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,511
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,357
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,140
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848