[ 
https://issues.apache.org/jira/browse/HDDS-9297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17774249#comment-17774249
 ] 

Duong commented on HDDS-9297:
-----------------------------

A (draft) implementation: [https://github.com/apache/ozone/pull/5427.]

I did a quick load test to measure the peak OM (pure reads) OPPS before and 
after this change.
{code:java}
ozone freon --set ozone.network.topology.aware.read=false ockrw -v duong -b obs 
-n 100000000 --contiguous -p mytest --percentage-read=100 -r 1000000 -s 0 -m 
--size 0 -t 140{code}
This change alone pushed the peak OPPS from *150K* to {*}193K{*}, and reduced 
the getKeyInfo latency from *570μs* to {*}340μs{*}.

!opps-compare-HDDS-9297.png|width=757,height=421!

!latency-compare-HDDS-9297.png|width=1081,height=401!

> getKeyInfo re-read bucket/volume info multiple times
> ----------------------------------------------------
>
>                 Key: HDDS-9297
>                 URL: https://issues.apache.org/jira/browse/HDDS-9297
>             Project: Apache Ozone
>          Issue Type: Improvement
>          Components: Ozone Manager
>    Affects Versions: 1.4.0
>            Reporter: Duong
>            Priority: Major
>              Labels: performance, pull-request-available
>         Attachments: latency-compare-HDDS-9297.png, 
> om-flamegraph-lockstripping.html, opps-compare-HDDS-9297.png
>
>
> OM's getKeyInfo API internally does the following steps:
> 1. Resolve bucket link: confirms that bucket/volume exists, resolve the 
> bucket's real name if the bucket param points to a soft link. 
> 2. ACL check: check if the user has access to the requested resource.
> 3. Read key metadata from rocks db.
> 4. Get block container location cache/SCM.
> 5. Generate block token for read.
> Although during (1), bucket/volume info is already retrieved from db/cache, 
> step (2) and (3) still re-read the same information to extract different 
> sub-attribute. e.g. (2) needs to read bucket/volume to get bucket/volume 
> owner name, (3) needs to get bucket layout.
> Those redundant reads unnecessarily add a significant cost to API, given that 
> each read involves locking, encoding/decoding results...
> We can simply populate all the needed information, e.g. bucket/volume owner, 
> and bucket layout, in the first step and reuse them across the remaining 
> steps. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to