Skip to content
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

Performance regression in aws-sigv4 1.5.0 #2729

Closed
johnduhart opened this issue Jul 18, 2022 · 2 comments · Fixed by #2730
Closed

Performance regression in aws-sigv4 1.5.0 #2729

johnduhart opened this issue Jul 18, 2022 · 2 comments · Fixed by #2730
Assignees
Labels
bug This issue is a bug.

Comments

@johnduhart
Copy link

Describe the bug

While doing performance profiling of our application which manually performs AWS SigV4 signing (for Amazon Neptune), we noticed a measurable amount of time being spent in Signer.use_crt?.

image

Looking closer, it appears to be calling require on each invocation.

image

We deployed a build with aws-sigv4 rolled back to 1.4.0, and we noticed a large improvement on the lower latency percentiles for calls to Amazon Neptune (latency includes signing, the HTTP request, and serialization).

aws-sigv4 version 1.4.0 1.5.0
P25 5ms 16ms
P50 5ms 17ms
P75 6ms 19ms
P90 7ms 22ms

Memoizing the use_crt? call would fix this issue. Installing and using the AWS CRT might also improve things, but given it's labeled as a developer preview, we decided to just rollback for now.

Expected Behavior

The same performance characteristics as 1.4.0

Current Behavior

Worsened performance.

Reproduction Steps

Benchmark the performance of sign_request between 1.4.0 and 1.5.0.

Possible Solution

No response

Additional Information/Context

No response

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sigv4

Environment details (Version of Ruby, OS environment)

Ruby 2.7.6, Linux

@johnduhart johnduhart added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 18, 2022
@alextwoods alextwoods self-assigned this Jul 18, 2022
@alextwoods alextwoods removed the needs-triage This issue or PR still needs to be triaged. label Jul 18, 2022
@alextwoods
Copy link
Contributor

Thanks for the detailed report - I'll work on a fix!

@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants