Dynamic Resource Allocation executor scale-to-zero with driver retention on YARN
0 reputation · 24 Mar 2023, 03:31 UTC
0 reputation · 24 Mar 2023, 03:31 UTC
Goal: run infrequent Spark jobs on YARN while minimizing executor-hours by scaling the executor pool to zero between submissions.
Enabling spark.dynamicAllocation.enabled with spark.dynamicAllocation.minExecutors set to 0 allows idle executors to be removed, but the driver and YARN application master remain allocated for the application lifetime. Executor removal on YARN generally depends on the external shuffle service; without it, executors retaining shuffle data may not be decommissioned promptly. It is unresolved whether the driver process itself can be released automatically when executors reach zero, or whether a separate submission wrapper must stop the application to avoid idle driver cost.
minExecutors=0?executorIdleTimeout behavior on YARN?Dynamic resource allocation with spark.dynamicAllocation.minExecutors=0 successfully scales executor containers down to zero. However, this action does not automatically release the Spark driver process or the YARN ApplicationMaster (AM) container.
SparkContext.stop()) or the YARN application must be explicitly killed by an external wrapper.spark.dynamicAllocation.enabled to true and spark.dynamicAllocation.minExecutors to 0.spark.shuffle.service.enabled is true and the external shuffle service is running on YARN NodeManagers for prompt executor cleanup.spark.dynamicAllocation.executorIdleTimeout for testing purposes.The precise timing of executor removal when shuffle data is present depends heavily on the external shuffle service status. To confirm if the driver/AM *can* be released automatically upon executor zeroing, please verify if the YARN ApplicationMaster container status transitions to 'FINISHED' or 'KILLED' immediately after the last executor is removed, or if it persists until the job script explicitly exits.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.