-
Notifications
You must be signed in to change notification settings - Fork 171
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
RUST-1337 Use tokio's AsyncRead
and AsyncWrite
traits
#668
RUST-1337 Use tokio's AsyncRead
and AsyncWrite
traits
#668
Conversation
Out of curiosity, is there a way to see how this patch affects the existing perf graph you linked from the jira ticket? or did you just confirm the perf has improved manually? |
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.
LGTM!
So if you click on a task (e.g. test-5.0-standalone) and click on a data point (a little arrow should appear), the % difference column will be populated. So for example, on the pre-regression point for BenchRead I'm seeing anywhere from -5% in score to +5%, which seems to be on track. |
Co-authored-by: Abraham Egnor <[email protected]>
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.
one question but LGTM!
}) | ||
let conn = connector | ||
.connect_with(name, tcp_stream, |c| { | ||
c.set_buffer_limit(None); |
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.
why do we need to set this explicitly now?
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'm not actually sure if this is required or not, but in the latest rustls version the default limit was changed from unlimited (what we use here) to 64KB. I changed it back to unlimited as that was my first guess at why the perf regression happened, though it alone didn't seem to have a significant impact. That said, rustls sets it to None
in their benchmarks, so perhaps its worth keeping here.
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.
sgtm to explicitly set it to future-proof things
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.
lgtm!
This fixes a performance regression that resulted from upgrading tokio-rustls and/or rustls.
RUST-1337
Upgrading to the most recent version
tokio-rustls
and/orrustls
caused a significant performance reduction in the driver when usingrustls
. This seems to have been fixed by switching to using tokio'sAsyncRead
trait for our stream types. I'm not entirely sure why this is the case to be honest, but it seems to work and reduced the code complexity a bit 🤷. For consistency, I also updated the write ends to use tokio'sAsyncWrite
, though that didn't have any effect on performance. As part of this, we can now remove the dependency onfutures_io
.perf patch: https://evergreen.mongodb.com/version/6296cd21d6d80a79a5061a14