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

[QUIC] Read can be highly inefficient #56891

Closed
wfurt opened this issue Aug 5, 2021 · 5 comments
Closed

[QUIC] Read can be highly inefficient #56891

wfurt opened this issue Aug 5, 2021 · 5 comments
Labels
area-System.Net.Quic enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Performance related issue
Milestone

Comments

@wfurt
Copy link
Member

wfurt commented Aug 5, 2021

I bump to this while looking at #56115

Consider the BigWrite_SmallRead_Success. We can receive 100b in single contiguous chunk and yet we would do 99 p/invokes to MsQuic and then receive 99 additional events via HandleEventRecv.

It feels like there is no point of informing MsQuic that we process something unless it is at least QuicBuffer.Length worth off data. There is no way IMHO it can return half of the buffer to the the OS.
Now, there is aspect that MsQuic can inform peer that some data were consumed but that only increases the inefficiency by sending extra data.

This probably needs deeper look.

@wfurt wfurt added tenet-performance Performance related issue area-System.Net.Quic labels Aug 5, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Aug 5, 2021
@ghost
Copy link

ghost commented Aug 5, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

I bump to this while looking at #56115

Consider the BigWrite_SmallRead_Success. We can receive 100b in single contiguous chunk and yet we would do 99 p/invokes to MsQuic and then receive 99 additional events via HandleEventRecv.

It feels like there is no point of informing MsQuic that we process something unless it is at least QuicBuffer.Length worth off data. There is no way IMHO it can return half of the buffer to the the OS.
Now, there is aspect that MsQuic can inform peer that some data were consumed but that only increases the inefficiency by sending extra data.

This probably needs deeper look.

Author: wfurt
Assignees: -
Labels:

area-System.Net.Quic, tenet-performance

Milestone: -

@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Aug 5, 2021
@ManickaP ManickaP added this to the Future milestone Aug 5, 2021
@geoffkizer
Copy link
Contributor

This seems a bit complex because the QuicBuffer could be really large, right? Say it's 64K, we consume 32K of it... it might be worth it to inform msquic that we consumed 32K so it can inform the peer and receive more data.

@wfurt
Copy link
Member Author

wfurt commented Aug 6, 2021

I'm wondering if we can get more than UDP packet ... or perhaps few. And if few, would that be split to multiple buffers to avoid allocations. Anyway, this looks like something to look into in future.

@karelz karelz modified the milestones: Future, 7.0.0 Nov 16, 2021
@karelz karelz added the enhancement Product code improvement that does NOT require public API changes/additions label Nov 16, 2021
@karelz
Copy link
Member

karelz commented Nov 16, 2021

Triage: Would show up when user reads smaller chunks of data (due to their protocol).
We might punt it to Future.

@karelz karelz modified the milestones: 7.0.0, Future Jun 14, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 14, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 13, 2022
@CarnaViire
Copy link
Member

Fixed in #71969

@karelz karelz modified the milestones: Future, 7.0.0 Aug 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Quic enhancement Product code improvement that does NOT require public API changes/additions tenet-performance Performance related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants