Jump to content

Push-based shuffle

From Open Lakehouse Wiki
Push-based shuffle
Also known as Push-based shuffle merge, spark.shuffle.push
Field Distributed data processing
Introduced Apache Spark 3.2.0 (SPARK-30602)
Key parts Block pushing from map tasks, merger locations on external shuffle services, merged shuffle partitions, merge finalization
Open source implementations Apache Spark on YARN with the external shuffle service
Related Shuffle, External shuffle service, Dynamic allocation
Last verified 23 November 2026 against the v4.3.0 tag of apache/spark (docs/configuration.md, push-based shuffle section and spark.shuffle.push.* settings) and SPARK-30602.

Push-based shuffle is an Apache Spark shuffle mode in which map tasks push their shuffle blocks to remote external shuffle services, which merge the blocks for each shuffle partition, so that reduce tasks can read a few large merged files instead of many small blocks. It was added in Spark 3.2.0 through the SPIP in SPARK-30602.[1] It is off by default and, in Spark 4.3.0, supported only for Spark on YARN with the external shuffle service.[2] The Spark 4.3.0 documentation describes it without a deprecated or experimental label.

What problem does push-based shuffle solve?

In a regular Spark shuffle, every reduce task fetches one block from every map task's output. The number of blocks therefore grows with the number of map tasks times the number of reduce tasks, and each block can be small. The SPIP describes large Spark-on-YARN deployments where the external shuffle service stores shuffle files on hard disks, and where these many small, random reads make the shuffle a scaling bottleneck and a source of inefficiency.[1]

What does push-based shuffle change?

  • Map side. After a map task writes its shuffle output as usual, Spark pushes the blocks, on a best-effort basis, to a set of external shuffle services chosen as merger locations for the shuffle.[2]
  • Merge. Each merger appends the pushed blocks for a partition into one merged shuffle file. After all map tasks are done, the driver waits spark.shuffle.push.finalize.timeout (default 10s) and then asks the mergers to finalize the merge.[2]
  • Reduce side. Reduce tasks read a combination of merged shuffle partitions and original shuffle blocks. Blocks that were not pushed or not merged are still fetched the normal way, which is why the push can be best effort.[2]

The result, according to the Spark docs, is that small random disk reads by the external shuffle services become large sequential reads, and that reduce tasks may also get better data locality, which reduces network I/O.[2] The docs describe the goal as improving both the reliability and the performance of the shuffle.[2]

Which cluster managers support push-based shuffle?

Cluster manager Push-based shuffle
YARN, with the external shuffle service Supported[2]
Standalone Not supported[2]
Kubernetes Not supported; Spark on Kubernetes has no external shuffle service[2][3]

The Spark docs state that push-based shuffle helps long-running jobs and queries with large disk I/O during shuffle, and is currently not well suited to jobs that run quickly on a small amount of shuffle data.[2]

How to enable push-based shuffle

Push-based shuffle needs a setting on both sides. On the server side, the external shuffle service in each NodeManager must use the merging implementation; on the client side, the application turns pushing on.[2]

# External shuffle service (server side), for example in the YARN shuffle service configuration
spark.shuffle.push.server.mergedShuffleFileManagerImpl  org.apache.spark.network.shuffle.RemoteBlockPushResolver

# Application (client side)
spark.shuffle.service.enabled   true
spark.shuffle.push.enabled      true

The server-side default, NoOpMergedShuffleFileManager, disables push-based shuffle.[2]

Main settings

Setting Default Meaning
spark.shuffle.push.enabled false Turn on pushing on the client side
spark.shuffle.push.finalize.timeout 10s Time the driver waits after all map tasks finish before finalizing the merge
spark.shuffle.push.maxBlockSizeToPush 1m Larger blocks are not pushed and are fetched the normal way
spark.shuffle.push.maxBlockBatchSize 3m Maximum size of a batch of blocks in one push request
spark.shuffle.push.minShuffleSizeToWait 500m Below this total shuffle size, the driver finalizes at once without waiting
spark.shuffle.push.minCompletedPushRatio 1.0 Fraction of map partitions that must finish pushing before finalization starts
spark.shuffle.push.mergersMinStaticThreshold 5 Minimum number of merger locations needed to use push-based shuffle for a stage
spark.shuffle.push.mergersMinThresholdRatio 0.05 Minimum merger locations as a ratio of the reduce stage's partitions; the larger of the two minimums applies

Source: Spark 4.3.0 configuration reference.[2]

If a stage cannot get enough merger locations, it does not use push-based shuffle. For example, a reduce stage with 100 partitions needs at least 5 merger locations with the default ratio.[2]

See also

References

  1. ↑ 1.0 1.1 SPARK-30602: SPIP: Support push-based shuffle to improve shuffle efficiency. Apache Software Foundation JIRA.Retrieved 2026-11-23.
  2. ↑ 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 Spark Configuration: Push-based shuffle overview (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.
  3. ↑ Job Scheduling (Spark 4.3.0). Apache Software Foundation.Retrieved 2026-11-23.