Project

General

Profile

[WAD] How to force lighttpd using "sendfile" in all payloads

Added by eecheng-lighttpd about 3 years ago

I'm running lighttpd on Linux and I found lighttpd use `writev` when requesting files that are smaller than 35 KiB. Otherwise, use `sendfile`.

I found there is an option: `server.network-backend` can be confined. Even I set it to "sendfile" or "linux-sendfile", lighttpd still uses `writev` to handle small payloads.

I'm wondering is there any way to force lighttpd always use `sendfile`?

Thanks in advance!


Replies (1)

RE: How to force lighttpd using "sendfile" in all payloads - Added by gstrauss about 3 years ago

I'm wondering is there any way to force lighttpd always use `sendfile`?

Why?

lighttpd reads small files into memory so that HTTP response headers and the response body can often be sent in a single system call (for small files), rather than a writev() of the headers followed by a sendfile() (and on Linux, surrounded by setsockopt() for TCP_CORK)

    (1-1/1)