Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.3.0
    • BucketCache
    • None
    • 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

              openinx Zheng Hu
              openinx Zheng Hu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: