Bug #987
closederror:network_freebsd_sendfile.c.175
Description
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
Updated by darix almost 18 years ago
so dont use sendfile if the underlying FS does not support it.
it is runtime configurable setting.
http://trac.lighttpd.net/trac/wiki/server.network-backendDetails
you have to use writev than.
Updated by Anonymous over 16 years ago
It's the server's job to switch as necessary. It's terrible to require this to be configured manually, when there's a clear, explicit error return from the syscall that can be used to detect it.
Updated by gstrauss almost 9 years 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.
Updated by stbuehler almost 9 years ago
- Description updated (diff)
- Status changed from New to Wontfix
- Assignee deleted (
jan) - Priority changed from High to Normal
Fallback on syscalls sounds unnecessary expensive, I don't think we should support this.
Updated by gstrauss over 8 years ago
- Is duplicate of Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernel added
Updated by gstrauss over 8 years ago
- 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.
Updated by gstrauss over 8 years ago
- Status changed from Patch Pending to Fixed
Applied in changeset c46f0ce027155924a53bf12cb306b3afb77bbd65.
Also available in: Atom