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

Reducing locking contention in TaskTracker.MapOutputServlet's LocalDirAllocator


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


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


        No work has yet been logged on this issue.


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


            • Created: