Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: BucketCache
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In HBASE-22483,  we saw that the BucketCacheWriter thread was quite busy [^BucketCacheWriter-is-busy.png],  the flame graph also indicated that the ByteBufferArray#internalTransfer cost ~6% CPU (see async-prof-pid-25042-cpu-1.svg). because we used the hbase.ipc.server.allocator.buffer.size=64KB, each HFileBlock will be backend  by a MultiByteBuff: one 64KB offheap ByteBuffer and one small heap ByteBuffer.   

      The path is depending on the MultiByteBuff#get(ByteBuffer, offset, len) now: 

      RAMQueueEntry#writeToCache
          |--> ByteBufferIOEngine#write
              |--> ByteBufferArray#internalTransfer
                  |--> ByteBufferArray$WRITER
                      |--> MultiByteBuff#get(ByteBuffer, offset, len)
      

      While the MultiByteBuff#get impl is simple and crude now, can optimze this implementation:

        @Override
        public void get(ByteBuffer out, int sourceOffset,
            int length) {
          checkRefCount();
            // Not used from real read path actually. So not going with
            // optimization
          for (int i = 0; i < length; ++i) {
            out.put(this.get(sourceOffset + i));
          }
        }
      

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                openinx Zheng Hu
                Reporter:
                openinx Zheng Hu
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: