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

Enabled TCP_CORK when sending a file #1586

Open
tanguilp opened this issue Nov 6, 2022 · 0 comments
Open

Enabled TCP_CORK when sending a file #1586

tanguilp opened this issue Nov 6, 2022 · 0 comments

Comments

@tanguilp
Copy link

tanguilp commented Nov 6, 2022

The TCP option TCP_CORK can be used to coalesce headers with the file being sent with the sendfile syscall:

If you plan to use sendfile() for sending files to a TCP socket, but need to send some header data in front of the file contents, you will find it useful to employ the TCP_CORK option, described in tcp(7), to minimize the number of packets and to tune performance

(from the manual of sendfile for Linux - implementations differ between OSes).

It'd be nice to enable it when sending file, although this might be a bit hard to pass the needed parameters to ranch because we need:

  • to enabled it before sending the headers
  • to disable it after calling sendfile

It also doesn't seem to be supported in inet, but only in the OTP22+ socket module.

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

No branches or pull requests

1 participant