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

high multiput latency due to checking global mem store size in a synchronized function

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.92.0
    • None
    • None
    • Reviewed

    Description

      The problem is we found the multiput latency is very high.
      In our case, we have almost 22 Regions in each RS and there are no flush happened during these puts.

      After investigation, we believe that the root cause is the function getGlobalMemStoreSize, which is to check the high water mark of mem store.
      This function takes almost 40% of total execution time of multiput when instrumenting some metrics in the code.
      The actual percentage may be more higher. The execution time is spent on synchronize contention.

      One solution is to keep a static var in HRegion to keep the global MemStore size instead of calculating them every time.
      Why using static variable?
      Since all the HRegion objects in the same JVM share the same memory heap, they need to share fate as well.
      The static variable, globalMemStroeSize, naturally shows the total mem usage in this shared memory heap for this JVM.
      If multiple RS need to run in the same JVM, they still need only one globalMemStroeSize.
      If multiple RS run on different JVMs, everything is fine.

      After changing, in our cases, the avg multiput latency decrease from 60ms to 10ms.

      I will submit a patch based on the current trunk.

      Attachments

        1. 3694-cliffs-counter.txt
          15 kB
          Ted Yu
        2. Hbase-3694[r1085306]
          6 kB
          Liyin Tang
        3. Hbase-3694[r1085306]_2.patch
          12 kB
          Liyin Tang
        4. Hbase-3694[r1085306]_3.patch
          13 kB
          Liyin Tang
        5. Hbase-3694[r1085508]_4.patch
          14 kB
          Liyin Tang
        6. Hbase-3694[r1085592]_7.patch
          15 kB
          Liyin Tang
        7. Hbase-3694[r1085593]_5.patch
          16 kB
          Liyin Tang
        8. Hbase-3694[r1085593]_6.patch
          15 kB
          Liyin Tang

        Activity

          People

            liyin Liyin Tang
            liyin Liyin Tang
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: