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

Reducing locking contention in TaskTracker.MapOutputServlet's LocalDirAllocator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.20.1
    • None
    • tasktracker
    • 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.

      Attachments

        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

        Activity

          People

            Unassigned Unassigned
            rajesh.balamohan Rajesh Balamohan
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated: