-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-9913. Reduce number of times configuration is loaded in Ozone client #5789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xichen01 for the patch.
| .setIsMultipartKey(true) | ||
| .enableUnsafeByteBufferConversion(unsafeByteBufferConversion) | ||
| .setConfig(conf.getObject(OzoneClientConfig.class)) | ||
| .setConfig(clientConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one, and the other two similar items are creating new configs intentionally. Please see HDDS-8216.
To reduce config loading, but still keep config loading to minimum, we could cache and reuse OzoneClientConfig instance per EC chunk size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand, but here we are using Configuration to pass parameters, which shouldn't be the role of Configuration. If a parameter needs to be computed at runtime, it should not be directly obtained from Configuration. Therefore, I added a StreamBufferArgs to modify and pass the StreamBuffe related parameters .
IMO, Configuration should ideally not provide a direct set method. Modifications to Configuration should only occur in "test code" and during "reconfiguration". Otherwise, Configuration should be read-only.
adoroszlai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @xichen01 for updating the patch. Creating an object for buffer args is a good idea.
…ient (apache#5789) (cherry picked from commit c990899)
What changes were proposed in this pull request?
Improving EC perf by eliminating redundant config reads.
The Root cause
The
conf.getObject(OzoneClientConfig.class)is an expensive operation, because the for ininjectConfigurationToObjectmay need to be looped many times and there will be a lot of configuration parsing operations.ozone/hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/ConfigurationReflectionUtil.java
Lines 89 to 99 in 8b25c55
getObjectis used heavily.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-9913
How was this patch tested?
existing test
Performance testing result
https://issues.apache.org/jira/browse/HDDS-9911