HBase
  1. HBase
  2. HBASE-5898

Consider double-checked locking for block cache lock

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.94.1
    • Fix Version/s: 0.94.3, 0.95.0
    • Component/s: Performance
    • Labels:
      None

      Description

      Running a workload with a high query rate against a dataset that fits in cache, I saw a lot of CPU being used in IdLock.getLockEntry, being called by HFileReaderV2.readBlock. Even though it was all cache hits, it was wasting a lot of CPU doing lock management here. I wrote a quick patch to switch to a double-checked locking and it improved throughput substantially for this workload.

      1. 5898-0.94.txt
        30 kB
        Lars Hofhansl
      2. 5898-TestBlocksRead.txt
        3 kB
        Ted Yu
      3. 5898-v2.txt
        6 kB
        Lars Hofhansl
      4. 5898-v3.txt
        8 kB
        Lars Hofhansl
      5. 5898-v4.txt
        30 kB
        Lars Hofhansl
      6. 5898-v4.txt
        30 kB
        Lars Hofhansl
      7. hbase-5898.txt
        2 kB
        Todd Lipcon
      8. HBASE-5898-0.patch
        6 kB
        Elliott Clark
      9. HBASE-5898-1.patch
        6 kB
        stack
      10. HBASE-5898-1.patch
        6 kB
        Elliott Clark

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Todd Lipcon
              Reporter:
              Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development