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

perf(dgw): use a buffer of 1k bytes for ARD VNC sessions #809

Merged
merged 7 commits into from
Apr 15, 2024

Conversation

CBenoit
Copy link
Member

@CBenoit CBenoit commented Apr 15, 2024

Apple ARD uses the so-called MVS video codec.
It is a tricky codec: Apple didn't implement proper congestion control, so it's basically just TCP controlling the flow (not by much).
Our MVS implementation for the web client is obviously not as fast as the native one, and can’t keep up when there are too much data in transit.
To reduce the amount of data in transit, we reduced the size of the copy buffer when using web socket forwarding endpoint and if the application protocol of the session is set to ARD.

Issue: DGW-138

RRRadicalEdward and others added 7 commits April 15, 2024 09:35
_ARD_ uses _MVS_ video codec which doesn't like buffering, and we need to have the buffer as minimal as possible.

Also, this commit adds new `copy_bidirectional` transport that is forked [the one from tokio](https://docs.rs/tokio/latest/tokio/io/fn.copy_bidirectional.html).
It's forked because the original function doesn't allow overriding the buffer size (8K is used by default). There is [an issue](tokio-rs/tokio#6454) on tokio side for it. We will be able to replace our fork with the upstream easily when it's ready.

Releated to Devolutions/IronVNC#338.
Co-authored-by: Benoît Cortier <bcortier@proton.me>
Copy link
Contributor

@pacmancoder pacmancoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@CBenoit CBenoit merged commit 5697097 into master Apr 15, 2024
35 of 36 checks passed
@CBenoit CBenoit deleted the lower-buffer-size-for-ard branch April 15, 2024 15:28
@RRRadicalEdward
Copy link
Contributor

RRRadicalEdward commented Apr 22, 2024

copy_bidirectional_with_sizes was added today: tokio-rs/tokio#6500.
We will be able to use in the next release. Stay tuned 😁

cc: @CBenoit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants