Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1904

Reducing locking contention in TaskTracker.MapOutputServlet's LocalDirAllocator

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.20.1
    • Fix Version/s: None
    • Component/s: tasktracker
    • Labels:
      None

      Description

      While profiling tasktracker with Sort benchmark, it was observed that threads block on LocalDirAllocator.getLocalPathToRead() in order to get the index file and temporary map output file.

      As LocalDirAllocator is tied up with ServetContext, only one instance would be available per tasktracker httpserver. Given the jobid & mapid, LocalDirAllocator retrieves index file path and temporary map output file path. getLocalPathToRead() is internally synchronized.

      Introducing a LRUCache for this lookup reduces the contention heavily (LRUCache with key =jobid +mapid and value=PATH to the file). Size of the LRUCache can be varied based on the environment and I observed a throughput improvement in the order of 4-7% with the introduction of LRUCache.

      1. Thread profiler output showing contention.jpg
        391 kB
        Rajesh Balamohan
      2. TaskTracker- yourkit profiler output .jpg
        237 kB
        Rajesh Balamohan
      3. profiler output after applying the patch.jpg
        211 kB
        Rajesh Balamohan
      4. MAPREDUCE-1904-trunk.patch
        6 kB
        Rajesh Balamohan
      5. MAPREDUCE-1904-RC10.patch
        3 kB
        Rajesh Balamohan
      6. LocalDirAllocator.JPG
        191 kB
        Rajesh Balamohan
      7. LocalDirAllocator_Monitor.JPG
        267 kB
        Rajesh Balamohan

        Activity

        Rajesh Balamohan made changes -
        Attachment LocalDirAllocator.JPG [ 12454429 ]
        Attachment LocalDirAllocator_Monitor.JPG [ 12454430 ]
        Rajesh Balamohan made changes -
        Attachment MAPREDUCE-1904-trunk.patch [ 12449918 ]
        Rajesh Balamohan made changes -
        Rajesh Balamohan made changes -
        Rajesh Balamohan made changes -
        Rajesh Balamohan made changes -
        Field Original Value New Value
        Attachment MAPREDUCE-1904-RC10.patch [ 12448732 ]
        Rajesh Balamohan created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Rajesh Balamohan
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:

              Development