Skip to content

Enabled TCP_CORK when sending a file #1586

@tanguilp

Description

@tanguilp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions