spark反序列化有时时间过长

星逍遥 2016-09-30 10:28:44

在spark集群中,服务器的配置是有差异的,其中配置稍差的服务器有时执行任务时反序列化时间会达到2分钟,使用的序列化方式是org.apache.spark.serializer.KryoSerializer,请问这是什么原因呢?

服务器配置:32core/126G
运行方式:在yarn上运行
资源使用:不到五分之一


...全文
905 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
java8964 2016-11-02
  • 打赏
  • 举报
回复
It may not necessary be data skew. The OP already mentioned that the data volume for this task is not much different with other tasks. But OP is not clear if there is always ONE task per executor is much slower than the rest tasks due to the task deserializing much longer. If this IS the case, that is most likely because of the time taken to ship the jars from the driver to the executors. You should only pay this cost once per spark context (assuming you are not adding more jars later on). When you submit your spark jobs, how large is your jar file? A hundred Ks is much difference as hundred Ms.
火阳邪神 2016-11-01
  • 打赏
  • 举报
回复
同意楼上意见 ,应该是数据倾斜了,可以增加分区数量,或者自定义分区方式来解决一下
LinkSe7en 2016-10-02
  • 打赏
  • 举报
回复
引用 3 楼 u012591139 的回复:
首先多谢楼上的答复。 我面临的问题是已经使用Kryo,并且也把一些类进行了注册。然而大约在200次执行完的stag中总会有一个或两个stage 的反序列化时间会到2分钟以上(正常是4秒左右的处理时间),而且处理的数据并不多。
那目测就是数据倾斜了,较大的分区数据被分配到较差的节点上。解决数据倾斜有很多办法,要视乎数据本身去处理。本质都是让每个分区尽可能分到相似数量的记录。
星逍遥 2016-09-30
  • 打赏
  • 举报
回复
星逍遥 2016-09-30
  • 打赏
  • 举报
回复
首先多谢楼上的答复。 我面临的问题是已经使用Kryo,并且也把一些类进行了注册。然而大约在200次执行完的stag中总会有一个或两个stage 的反序列化时间会到2分钟以上(正常是4秒左右的处理时间),而且处理的数据并不多。
LinkSe7en 2016-09-30
  • 打赏
  • 举报
回复
刚刚看到一篇文章,可能对你有帮助这里

1,261

社区成员

发帖
与我相关
我的任务
社区描述
Spark由Scala写成,是UC Berkeley AMP lab所开源的类Hadoop MapReduce的通用的并行计算框架,Spark基于MapReduce算法实现的分布式计算。
社区管理员
  • Spark
  • shiter
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧