Bug #987



Added by Anonymous almost 15 years ago. Updated over 5 years ago.

Target version:


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

Related issues

Is duplicate of Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelFixedActions
Actions #1

Updated by darix almost 15 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.

Actions #2

Updated by Anonymous over 13 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.

Actions #3

Updated by gstrauss almost 6 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.

Actions #4

Updated by stbuehler almost 6 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.

Actions #5

Updated by gstrauss almost 6 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
Actions #6

Updated by gstrauss almost 6 years ago

  • Status changed from Wontfix to Patch Pending
  • Target version set to 1.4.40

Submitted pull request

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 with large file uploads stored in tempfiles being sent to backend via unix domain sockets on (older?) versions of Solaris.

Actions #7

Updated by gstrauss over 5 years ago

  • Status changed from Patch Pending to Fixed

Also available in: Atom