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

CompactedHFilesDischarger may lead to high cpu usage

    XMLWordPrintableJSON

Details

    • Brainstorming
    • Status: Resolved
    • Minor
    • Resolution: Incomplete
    • None
    • None
    • None
    • None

    Description

      in one of  online cluster(RS:16C72G, hbase version is 2.x) ,  cpu average usage is 30%,  but cpu usage may above 80%  occasionally.  by a  enchanced 'top -H' script, i find  'RS_COMPACTED_FILES_DISCHARGER' threads can use  50%+ cpu ( 10 * 80% ).  

       

       

      by jstack , we found most of stacks is at.

       "org.apache.hadoop.hbase.io.hfile.LruBlockCache#evictBlocksByHfileName"

         public int evictBlocksByHfileName(String hfileName) {
            int numEvicted = 0;
            for (BlockCacheKey key : map.keySet()) {
               if (key.getHfileName().equals(hfileName))

      {              if (evictBlock(key))              ++numEvicted;          }

            }
            if (victimHandler != null)

      {           numEvicted += victimHandler.evictBlocksByHfileName(hfileName);       }

            return numEvicted;
       }

       

      when close storefile, now we evict it's blocks from cache,  but we have to  traverse the whole blockcache to locate the block cached, and can lead to high cpu usage.

      do we need evict blockcache when close file, even for a small file ( size less than 10MB)?  it's a lru block cache, the unused block will be automatically removed from cache when blockcache usage is high?  

       

      Attachments

        1. compated_discharger.png
          951 kB
          junfei liang

        Activity

          People

            Unassigned Unassigned
            fly2best junfei liang
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: