[
https://issues.apache.org/jira/browse/HDDS-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17768420#comment-17768420
]
Tanvi Penumudy commented on HDDS-8154:
--------------------------------------
Performed async-profiling with/without MAC optimization (HDDS-8154: {_}Reuse
Mac instances in S3 token validation{_}) - attached the flame charts for both.
* {{AWSV4AuthValidator.validateRequest}} -> *11.35%* _(pre-optimization)_ vs
*3.40%* _(post-optimization)._
* {{Mac.init}} -> *3.27%* _(pre-optimization)_ vs *0.85%* _(post-optimization)_
There’s about 3.3-3.8x performance improvement in this particular module.
* Flame graph with MAC optimization:
[^om-perf-profiling-with-mac-optimization.html]
* Flame graph without MAC optimization:
[^om-perf-profiling-without-mac-optimization.html]
> 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]