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

Wei-Chiu Chuang commented on HDDS-8154:
---------------------------------------

Nice work! Really love this one!

> Perf: Reuse Mac instances in S3 token validation
> ------------------------------------------------
>
>                 Key: HDDS-8154
>                 URL: https://issues.apache.org/jira/browse/HDDS-8154
>             Project: Apache Ozone
>          Issue Type: Improvement
>            Reporter: Duong
>            Assignee: Tanvi Penumudy
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.4.0
>
>         Attachments: Screen Shot 2023-03-13 at 11.33.35 AM.png, 
> om-perf-profiling-with-mac-optimization.html, 
> om-perf-profiling-without-mac-optimization.html
>
>
> Creating Mac instances and initializing dominates the cost of S3 token 
> validation, which is a big part of OM latencies for the S3 use case. 
> {code:java}
> Mac mac = Mac.getInstance(HMAC_SHA256_ALGORITHM);
> mac.init(signingKey); {code}
> !Screen Shot 2023-03-13 at 11.33.35 AM.png|width=939,height=355!
> Cache Mac instances (in ThreadLocal as they're stateful) and reusing them 
> help avoid creating and initializing those objects from scratch. That will 
> greatly reduce the cost of S3 validation.
> Code example: 
> [https://github.com/apache/hadoop/blob/master/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/SecretManager.java#L124-L124]



--
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