diff options
author | Matei Zaharia <matei@databricks.com> | 2014-08-07 18:04:49 -0700 |
---|---|---|
committer | Reynold Xin <rxin@apache.org> | 2014-08-07 18:06:57 -0700 |
commit | 0f2274f8ed6131ad17326e3fff7f7e093863b72d (patch) | |
tree | 1dc2085ec7de369cf337ed178b28be2baa77ef5b /docs/configuration.md | |
parent | 30369b80636032839992bf4bce1d1961062f0058 (diff) | |
download | spark-0f2274f8ed6131ad17326e3fff7f7e093863b72d.tar.gz spark-0f2274f8ed6131ad17326e3fff7f7e093863b72d.tar.bz2 spark-0f2274f8ed6131ad17326e3fff7f7e093863b72d.zip |
SPARK-2787: Make sort-based shuffle write files directly when there's no sorting/aggregation and # partitions is small
As described in https://issues.apache.org/jira/browse/SPARK-2787, right now sort-based shuffle is more expensive than hash-based for map operations that do no partial aggregation or sorting, such as groupByKey. This is because it has to serialize each data item twice (once when spilling to intermediate files, and then again when merging these files object-by-object). This patch adds a code path to just write separate files directly if the # of output partitions is small, and concatenate them at the end to produce a sorted file.
On the unit test side, I added some tests that force or don't force this bypass path to be used, and checked that our tests for other features (e.g. all the operations) cover both cases.
Author: Matei Zaharia <matei@databricks.com>
Closes #1799 from mateiz/SPARK-2787 and squashes the following commits:
88cf26a [Matei Zaharia] Fix rebase
10233af [Matei Zaharia] Review comments
398cb95 [Matei Zaharia] Fix looking up shuffle manager in conf
ca3efd9 [Matei Zaharia] Add docs for shuffle manager properties, and allow short names for them
d0ae3c5 [Matei Zaharia] Fix some comments
90d084f [Matei Zaharia] Add code path to bypass merge-sort in ExternalSorter, and tests
31e5d7c [Matei Zaharia] Move existing logic for writing partitioned files into ExternalSorter
(cherry picked from commit 6906b69cf568015f20c7d7c77cbcba650e5431a9)
Signed-off-by: Reynold Xin <rxin@apache.org>
Diffstat (limited to 'docs/configuration.md')
-rw-r--r-- | docs/configuration.md | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/configuration.md b/docs/configuration.md index 5e3eb0f087..4d27c5a918 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -281,6 +281,24 @@ Apart from these, the following properties are also available, and may be useful overhead per reduce task, so keep it small unless you have a large amount of memory. </td> </tr> +<tr> + <td><code>spark.shuffle.manager</code></td> + <td>HASH</td> + <td> + Implementation to use for shuffling data. A hash-based shuffle manager is the default, but + starting in Spark 1.1 there is an experimental sort-based shuffle manager that is more + memory-efficient in environments with small executors, such as YARN. To use that, change + this value to <code>SORT</code>. + </td> +</tr> +<tr> + <td><code>spark.shuffle.sort.bypassMergeThreshold</code></td> + <td>200</td> + <td> + (Advanced) In the sort-based shuffle manager, avoid merge-sorting data if there is no + map-side aggregation and there are at most this many reduce partitions. + </td> +</tr> </table> #### Spark UI |