-
Notifications
You must be signed in to change notification settings - Fork 0
jvm调优
jvm 堆
young :新生代区
(eden survive2 survive1 )
对象首先会创建到eden survive1 区,由于绝大部分对象会回收 minor gc , 多次回收 还存活的 会进入survive2 区,最后到 old区,
survive2满了 对象会通过jvm担保机制进入old区
默认大小比 eden :survive1:survive2 8:1:1 ,
old: 经过young长时间稳定存活的对象不会经常回收 ,但是回收通过 full gc 极大降低性能
spark中有60%用于对象缓存 40%用于jvm .优化之一是进行 大小重新分配
executor堆外内存调优
spark作业特别大,shuffle file cannot find ,executor lost,task lost ,out of memory
可能executor堆外内存不够,导致溢出,然后可能导致后续的stage的task在运行的时候,可能要出一些exucutor中去拉去shuffle map output 文件
,但是executor已经挂了,关联的block manager没有了,所以可能报 shuffle file cannot find ,executor lost,task lost
,spark最后崩溃.
可以考虑调节堆外内存,堆外内存大 性能提升.
--conf spark.yarn.executor.memoryOverhead=2048
通常2g
executor 超时时长 gc引起的
--conf spark.core.connection.ack.wait.timeout=300
/usr/local/spark/bin/spark-submit
- class com.ibeifengsparkstudy.WordCount
--num-executors 80 \ (50-100)
--driver-memory 6g \ (1-5)
--executor-memory 6g\ (6-10)
--executor-cores 3\
--master yarn-cluster \
--queue root.default \
--conf spark.yarn.executor.memoryOverhe ad=2048 \
--conf spark.core.connection.ack.wait.timeout=300 \
/usr/local/spark/spark.jar \
{ taskid}