zoukankan      html  css  js  c++  java
  • 6、task,线程和executor间的关系

    spark.task.cpus 2        //每个task分配的core数,默认1
    
    --executor-cores 5        //每个执行器占用的core数.
    
    --num-executors    2        //yarn模式指定执行器个数
    
    solt                    //槽位,本质上对应一个线程,slot数指job最大的并发度。
                            //最发并发度是job同时启动的线程数。 = executors个数 * 每个执行器内核数 / 每个task占用内核数

    测试

    -- 配置方式 , 开启4个线程,
    spark-shell --master yarn --deploy-mode client --executor-cores 5 --num-executors 2 --conf spark.task.cpus=2
    $scala>sc.makeRDD(1 to 5 , 5).map(e=>{sendInfo(this , "map" , e+ "") ; e * 2}).collect

    结果

    192.168.231.102/21236/Executor task launch worker-0/$iw@1149152433/map(1)
    192.168.231.102/21236/Executor task launch worker-0/$iw@1214110238/map(5)
    192.168.231.102/21236/Executor task launch worker-1/$iw@1841808265/map(3)
    
    192.168.231.103/11298/Executor task launch worker-0/$iw@1477418664/map(2)
    192.168.231.103/11298/Executor task launch worker-1/$iw@573835569/map(4)
    渐变 --> 突变
  • 相关阅读:
    c#中的Unity容器
    c# Task 篇幅二
    C# Task 篇幅一
    多线程Thread,线程池ThreadPool
    第十二章:二叉查找树(1)
    第十章:基本数据结构(2)
    第十章:基本数据结构(1)
    第十章:基本数据结构(0)
    劝学
    CentOS7安装Docker CE
  • 原文地址:https://www.cnblogs.com/lybpy/p/9784256.html
Copyright © 2011-2022 走看看