<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Feeling

        三人行,必有我師焉

       ::  :: 新隨筆 :: 聯系 ::  :: 管理 ::
      185 隨筆 :: 0 文章 :: 392 評論 :: 0 Trackbacks

    spark中有partition的概念(和slice是同一個概念,在spark1.2中官網已經做出了說明),一般每個partition對應一個task。在我的測試過程中,如果沒有設置spark.default.parallelism參數,spark計算出來的partition非常巨大,與我的cores非常不搭。我在兩臺機器上(8cores *2 +6g * 2)上,spark計算出來的partition達到2.8萬個,也就是2.9萬個tasks,每個task完成時間都是幾毫秒或者零點幾毫秒,執行起來非常緩慢。在我嘗試設置了 spark.default.parallelism 后,任務數減少到10,執行一次計算過程從minute降到20second。

    參數可以通過spark_home/conf/spark-default.conf配置文件設置。

    eg.

    spark.master  spark://master:7077 

    spark.default.parallelism  10 

    spark.driver.memory  2g 

    spark.serializer  org.apache.spark.serializer.KryoSerializer 

    spark.sql.shuffle.partitions  50

     

    下面是官網的相關描述:

    from:http://spark.apache.org/docs/latest/configuration.html

    Property NameDefaultMeaning
    spark.default.parallelism For distributed shuffle operations like reduceByKey and join, the largest number of partitions in a parent RDD. For operations likeparallelize with no parent RDDs, it depends on the cluster manager:
    • Local mode: number of cores on the local machine
    • Mesos fine grained mode: 8
    • Others: total number of cores on all executor nodes or 2, whichever is larger
    Default number of partitions in RDDs returned by transformations like joinreduceByKey, and parallelize when not set by user.

    from:http://spark.apache.org/docs/latest/tuning.html

    Level of Parallelism

    Clusters will not be fully utilized unless you set the level of parallelism for each operation high enough. Spark automatically sets the number of “map” tasks to run on each file according to its size (though you can control it through optional parameters to SparkContext.textFile, etc), and for distributed “reduce” operations, such as groupByKey and reduceByKey, it uses the largest parent RDD’s number of partitions. You can pass the level of parallelism as a second argument (see the spark.PairRDDFunctions documentation), or set the config propertyspark.default.parallelism to change the default. In general, we recommend 2-3 tasks per CPU core in your cluster.


    原文地址:http://www.cnblogs.com/wrencai/p/4231966.html

    posted on 2016-09-08 13:07 三人行,必有我師焉 閱讀(2207) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    GitHub |  開源中國社區 |  maven倉庫 |  文件格式轉換 
    主站蜘蛛池模板: 日本在线免费观看| 中中文字幕亚洲无线码| 亚洲欧洲日产v特级毛片| 国产免费MV大全视频网站| 免费a级黄色毛片| 色多多免费视频观看区一区| 色www永久免费视频| 国产AV日韩A∨亚洲AV电影| 国产嫩草影院精品免费网址| 国产成人精品亚洲| 亚洲国产精品尤物YW在线观看| 一级毛片aa高清免费观看| 中文字幕精品无码亚洲字| 日韩av无码免费播放| 亚洲成在人天堂一区二区| 99re6在线精品视频免费播放 | 日韩毛片无码永久免费看| 久久亚洲中文无码咪咪爱| 国产在线播放免费| 久久精品无码专区免费| 亚洲成A人片777777| 91九色老熟女免费资源站| 国产AV旡码专区亚洲AV苍井空| 免费a级毛片大学生免费观看 | 日本免费网站在线观看| 黄页网站在线视频免费| 亚洲av综合色区| 国内精品免费麻豆网站91麻豆| 亚洲av午夜国产精品无码中文字 | 中文字幕无码播放免费| 亚洲av无码兔费综合| 亚洲一区爱区精品无码| 四虎在线视频免费观看视频| 337p日本欧洲亚洲大胆人人 | 一区二区三区AV高清免费波多| 久久亚洲精品中文字幕无码| 97人伦色伦成人免费视频| 九九久久精品国产免费看小说 | 免费大黄网站在线观看| 国产精品免费大片| 亚洲AV无码国产一区二区三区|