I seem to have a problem serving files with
lighttpd from non local (smbfs) filesystem.
Lighttpd tries to use sendfile but, i have the following error:
(network_freebsd_sendfile.c.175) sendfile: Operation not supported 45
(connections.c.588) connection closed: write failed on fd 7.
The version is lighttpd-1.4.13
"sendfile backends do not fall back to write/writev if they are not supported by the kernel"
github: closes #58
#1 Updated by darix about 10 years ago
so dont use sendfile if the underlying FS does not support it.
it is runtime configurable setting.
you have to use writev than.
#3 Updated by gstrauss about 1 year ago
This is a very old ticket, but is marked High Priority.
On some systems, some filesystems support sendfile() and some do not. If lighttpd is configured to use sendfile() as the backend -- which is a global setting in lighttpd and not configurable per filesystem -- it would be nice if lighttpd could fall back to write() if sendfile() failed with EOPNOTSUPP. (feature request)
Please downgrade priority and mark this ticket as Feature Request.
This ticket should not be High Priority (and a 7-year-old ticket obviously wasn't :)) since there is a simple workaround: if you need to serve some files from a filesystem that does not support sendfile(), then do not use the freedbsd sendfile network backend in lighttpd.conf.
- Status changed from Wontfix to Patch Pending
- Target version set to 1.4.40
Submitted pull request https://github.com/lighttpd/lighttpd1.4/pull/58
An extra syscall each write is better than failure.
If someone changes the default backend, and then does not test to see if performance improves or degrades, then they will still have a working server. Anyone interested in performance should actually be measuring performance before and after tuning the settings.
This patch allows sendfile to be the chosen backend even if a smaller portion of requests fail with sendfile and fall back to write, e.g. the case in https://redmine.lighttpd.net/issues/471 with large file uploads stored in tempfiles being sent to backend via unix domain sockets on (older?) versions of Solaris.
Also available in: Atom