Spark中各個角色的JVM引數設定

2022-09-14 17:27:17 字數 1248 閱讀 7366

總結一下spark中各個角色的jvm引數設定:   

(1)driver的jvm引數:

-xmx,-xms,如果是yarn-client模式,則預設讀取spark-env檔案中的spark_driver_memory值,-xmx,-xms值一樣大小;如果是yarn-cluster模式,則讀取的是spark-default.conf檔案中的spark.driver.extraj**aoptions對應的jvm引數值。

permsize,如果是yarn-client模式,則是預設讀取spark-class檔案中的j**a_opts="-xx:maxpermsize=256m $our_j**a_opts"值;如果是yarn-cluster模式,讀取的是spark-default.conf檔案中的spark.driver.extraj**aoptions對應的jvm引數值。

gc方式,如果是yarn-client模式,預設讀取的是spark-class檔案中的j**a_opts;如果是yarn-cluster模式,則讀取的是spark-default.conf檔案中的spark.driver.extraj**aoptions對應的引數值。

以上值最後均可被spark-submit工具中的--driver-j**a-options引數覆蓋。

(2)executor的jvm引數:

-xmx,-xms,如果是yarn-client模式,則預設讀取spark-env檔案中的spark_executor_memory值,-xmx,-xms值一樣大小;如果是yarn-cluster模式,則讀取的是spark-default.conf檔案中的spark.executor.extraj**aoptions對應的jvm引數值。

permsize,兩種模式都是讀取的是spark-default.conf檔案中的spark.executor.extraj**aoptions對應的jvm引數值。

gc方式,兩種模式都是讀取的是spark-default.conf檔案中的spark.executor.extraj**aoptions對應的jvm引數值。

(3)executor數目及所佔cpu個數

如果是yarn-client模式,executor數目由spark-env中的spark_executor_instances指定,每個例項的數目由spark_executor_cores指定;如果是yarn-cluster模式,executor的數目由spark-submit工具的--num-executors引數指定,預設是2個例項,而每個executor使用的cpu數目由--executor-cores指定,預設為1核。

檢視JVM各個代的記憶體狀態

在linux執行 jmap heap pid 可以看到如下資訊 attaching to process id 23990,please wait.warning the type const char declared in the remote vm in vmstructs localhots...

Spark與JVM高階特性 Object的值傳遞

找不同 var oldedges cogroup rdd int,iterable array int array int array int array int array int iterable array array int graph.flatmap s groupbykey map s ...

shell指令碼程式設計中條件判斷語句中各個引數的含義

linux下條件判斷語句的格式如下 ps 這裡需要特別注意的是,條件與 與 之間有空格,if與 之間也需要空格 if condition1 then if condition2 then else fi command strings else command strings fi檔案的判斷的表示式...