Skip to content

Commit 9da1cd0

Browse files
committed
[SPARK-50996][K8S] Increase spark.kubernetes.allocation.batch.size to 10
### What changes were proposed in this pull request? This PR aims to increase `spark.kubernetes.allocation.batch.size` to 10 from 5 in Apache Spark 4.0.0. ### Why are the changes needed? Since Apache Spark 2.3.0, Apache Spark uses `5` as the default value of executor allocation batch size for 8 years conservatively. - #19468 Given that the improvement of K8s hardware infrastructure for last 8 year, we had better use a bigger value, `10`, from Apache Spark 4.0.0 in 2025. Technically, when we request 1200 executor pod, - Batch Size `5` takes 4 minutes. - Batch Size `10` takes 2 minutes. ### Does this PR introduce _any_ user-facing change? Yes, the users will see faster Spark job resource allocation. The migration guide is updated correspondingly. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #49681 from dongjoon-hyun/SPARK-50996. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent e7821c8 commit 9da1cd0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docs/core-migration-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ license: |
3636

3737
- In Spark 4.0, support for Apache Mesos as a resource manager was removed.
3838

39+
- Since Spark 4.0, Spark will allocate executor pods with a batch size of `10`. To restore the legacy behavior, you can set `spark.kubernetes.allocation.batch.size` to `5`.
40+
3941
- Since Spark 4.0, Spark uses `ReadWriteOncePod` instead of `ReadWriteOnce` access mode in persistence volume claims. To restore the legacy behavior, you can set `spark.kubernetes.legacy.useReadWriteOnceAccessMode` to `true`.
4042

4143
- Since Spark 4.0, Spark reports its executor pod status by checking all containers of that pod. To restore the legacy behavior, you can set `spark.kubernetes.executor.checkAllContainers` to `false`.

docs/running-on-kubernetes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ See the [configuration page](configuration.html) for information on Spark config
682682
</tr>
683683
<tr>
684684
<td><code>spark.kubernetes.allocation.batch.size</code></td>
685-
<td><code>5</code></td>
685+
<td><code>10</code></td>
686686
<td>
687687
Number of pods to launch at once in each round of executor pod allocation.
688688
</td>

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ private[spark] object Config extends Logging {
450450
.version("2.3.0")
451451
.intConf
452452
.checkValue(value => value > 0, "Allocation batch size should be a positive integer")
453-
.createWithDefault(5)
453+
.createWithDefault(10)
454454

455455
val KUBERNETES_ALLOCATION_BATCH_DELAY =
456456
ConfigBuilder("spark.kubernetes.allocation.batch.delay")

0 commit comments

Comments
 (0)