Thibault Deutsch created HBASE-28488:
----------------------------------------

             Summary: Avoid expensive allocation in createRegionSpan
                 Key: HBASE-28488
                 URL: https://issues.apache.org/jira/browse/HBASE-28488
             Project: HBase
          Issue Type: Improvement
          Components: tracing
    Affects Versions: 2.5.0
         Environment: Multiple clusters with:
 * OpenJDK 11.0.22+7 
 * HBase 2.5.7
 * 10-150 RegionServers
 * 90-95% writes requests
            Reporter: Thibault Deutsch
         Attachments: Screenshot 2024-04-05 at 00.27.11.png

On our busy clusters, the alloc profile shows that createRegionSpan() is 
responsible for 15-20% of all the allocations. These allocations comes from 
getRegionNameAsString().

getRegionNameAsString() takes the region name and encode invisible characters 
in their hex representation. This requires the use of a StringBuilder and thus 
generate new strings every time.

This becomes really expensive on a cluster with high number of requests. We 
have a patch that replaced the call with getEncodedName() instead. It seems 
better to just take the encoded region name (the md5 part) and use that in 
trace attributes, because:
- it's fixed in size (the full region name can be much longer depending on the 
rowkey size),
- it's enough information to link a trace to a region,
- it doesn't require any new allocation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to