Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-5898

Consider double-checked locking for block cache lock

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 0.94.1
    • 0.94.3, 0.95.0
    • Performance
    • 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.

      Attachments

        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 Neil Clark
        9. HBASE-5898-1.patch
          6 kB
          Michael Stack
        10. HBASE-5898-1.patch
          6 kB
          Elliott Neil Clark

        Issue Links

          Activity

            People

              tlipcon Todd Lipcon
              tlipcon Todd Lipcon
              Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: