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

Use UDP segmentation offload when available #501

Closed
Ralith opened this issue Nov 18, 2019 · 4 comments
Closed

Use UDP segmentation offload when available #501

Ralith opened this issue Nov 18, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@Ralith
Copy link
Collaborator

Ralith commented Nov 18, 2019

Even with #491, the kernel part of sending is about a third of the large stream benchmark, maybe more if criterion overhead and receiver activity is excluded. ngtcp2 reports achieving 6.1Gbps using segmentation offload on recent Windows, and Linux acquired a similar feature as exercised in https://github.com/torvalds/linux/blob/master/tools/testing/selftests/net/udpgso.c and discussed in this paper. Care will need to be taken to preserve fallback support in environments where these are not available; on Linux this can be done with a runtime check, and on windows you can try to dynamically load the symbol from the relevant dll.

IIRC segmentation offload requires that all datagrams be destined to the same address, so this will require modifying the poll_transmit API to be batched. Similar measures can probably be applied to the receive path.

@Ralith Ralith added the enhancement New feature or request label Nov 18, 2019
@Ralith
Copy link
Collaborator Author

Ralith commented Nov 19, 2019

Linux also recently grew support for zero-copy UDP send/recv, reporting dramatic speedups in microbenchmarks as a result: https://patchwork.ozlabs.org/patch/1006175/. It's described as only useful when combined with segmentation offload, as it needs to work in coarse units to be a performance benefit.

@Ralith
Copy link
Collaborator Author

Ralith commented Jan 6, 2020

The nginx folks report remarkable results from taking advantage of this: https://calendar.perfplanet.com/2019/accelerating-udp-packet-transmission-for-quic/

@Ralith
Copy link
Collaborator Author

Ralith commented May 1, 2020

https://www.fastly.com/blog/measuring-quic-vs-tcp-computational-efficiency reports better-than-TLS+TCP performance

@Ralith
Copy link
Collaborator Author

Ralith commented Mar 20, 2021

This was implemented in #1054.

@Ralith Ralith closed this as completed Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant