Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-6923

Optimize MapReduce Shuffle I/O for small partitions

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.0, 3.0.0-beta1
    • Component/s: None
    • Labels:
    • Environment:

      Observed in Hadoop 2.7.3 and above (judging from the source code of future versions), and Ubuntu 16.04.


      When a job configuration results in small partitions read by each reducer from each mapper (e.g. 65 kilobytes as in my setup: a TeraSort of 256 gigabytes using 2048 mappers and reducers each), and setting


      then the default setting of


      results in almost 100% overhead in reads during shuffle in YARN, because for each 65K needed, 128K are read.

      I propose a fix in FadvisedFileRegion.java as follows:

      ByteBuffer byteBuffer = ByteBuffer.allocate(Math.min(this.shuffleBufferSize, trans > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) trans));

      e.g. here. This sets the shuffle buffer size to the minimum value of the shuffle buffer size specified in the configuration (128K by default), and the actual partition size (65K on average in my setup). In my benchmarks this reduced the read overhead in YARN from about 100% (255 additional gigabytes as described above) down to about 18% (an additional 45 gigabytes). The runtime of the job remained the same in my setup.


        1. MAPREDUCE-6923.01.patch
          3 kB
          Robert Schmidtke
        2. MAPREDUCE-6923.00.patch
          2 kB
          Robert Schmidtke

        Issue Links



            • Assignee:
              rosch Robert Schmidtke
              rosch Robert Schmidtke


              • Created:

                Issue deployment