Skip to content

Use linux sendfile for PhysicalFile response #18093

@maknapp

Description

@maknapp

Is your feature request related to a problem? Please describe.

I was expecting PhysicalFile to use the sendfile system call in linux but all it does is stream the file using this fallback:

https://github.com/aspnet/AspNetCore/blob/7ae6d1e3791e09db1fe2b032044208b04d4cc3b1/src/Http/Http/src/SendFileFallback.cs

This fallback uses much more CPU and memory to serve files than using the sendfile system call.

Describe the solution you'd like

I'd like an option to enable sendfile responses, either in setup or for each response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: Won't FixResolved because we decided not to change the behavior reported in this issue.Status: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-kestrel

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions