https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412006-02-16T02:07:42Zlighty labsLighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11902006-02-16T02:07:42ZAnonymous
<ul></ul><p>same here. lighttpd 1.4.10, sunos 5.11 x86_64. problem is at src/connections.c:1013<br />when request content size > 64k, use another way to post to php: write all <br />request body to a file, and then use solaris sendfilev to write from this file fd to<br />php-fcgi unix socket. But /lib/64/libsendfile.so.1 which lighttpd links to does<br />not support to write to a unix socket. I don't know if there's any way of enabling<br />this if I recompile the libsendfile.so.</p>
<p>the workaround I am using is to disable solaris' sendfilev in<br />src/network_backends.h, but I don't know if solaris' sendfilev is much more<br />efficient than the linux sendfile call in solaris.</p>
<p>This has to be fixed.</p>
<p>-- atppp</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11912006-11-15T12:45:57Zjan
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Assigned</i></li></ul><p>I need a login to sol10 to develop a patch for this. Can someone provide me with one ?</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11922006-11-30T23:50:56ZAnonymous
<ul></ul><p>It may not be the best way, but I seem to have solved it with:</p>
<pre>
/* Solaris sendfilev() */
if (-1 == (r = sendfilev(fd, &fvec, 1, &written))) {
if (errno == EAFNOSUPPORT) {
buffer_prepare_copy(srv->tmp_buf, toSend);
lseek(ifd, offset, SEEK_SET);
if (-1 == (toSend = read(ifd, srv->tmp_buf->ptr, toSend))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "read: ", strerror(errno));
close(ifd);
return -1;
}
if (-1 == (written = send(fd, srv->tmp_buf->ptr, toSend, 0))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "write: ", strerror(errno));
close(ifd);
return -1;
}
} else if (errno != EAGAIN) {
log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno);
close(ifd);
return -1;
}
</pre>
<p>-- joe</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11932007-06-06T12:10:32ZAnonymous
<ul></ul><p>Hi there,</p>
<p>I am suffering from this same error in our Rails app. We are using 1.4.13.<br />Has any progress been made on solving this?</p>
<p>I'm a web-developer and not too familiar with this lower-level stuff. Can I be of assistance in anyway as this is killing our production site (we just moved to text-drive who use OpenSolaris boxes).</p>
<p>Cheers.</p>
<p>-- lachy</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11942007-06-06T17:23:47ZAnonymous
<ul></ul><p>The patch I posted above has been working perfectly for me. You should give it a try to see if it works for you too.</p>
<p>-- joe</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11952007-06-10T18:46:53ZAnonymous
<ul></ul><p>Why hasn't this patch been added to the trunk? This is a pretty serious bug.</p>
<p>-- magnus</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11962007-10-10T15:23:58ZAnonymous
<ul></ul><p>hi,<br />thanks for the fix.<br />We are using sol 10 and Lighttpd 1.4.18 which still has this problem.</p>
<p>-- Jason</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11972008-04-24T08:56:03Zstbuehler
<ul></ul><p>If your OS doesn't provide a proper sendfile implementation (i.e. unable to send files over unix sockets), then just don't use it as network handler.</p>
<p>Of course it would be nice if lighttpd provided a fallback, but that should be done in a proper way and i don't know if someone wants to do this for 1.4.x as that would be a major change in my eyes.</p>
<p>I will not close this bug so others can find it (and i agree it really is a bug), but i don't think it will be fixed soon.</p>
<p>Perhaps <a class="email" href="mailto:joe@thrallingpenguin.com">joe@thrallingpenguin.com</a> can attach his fix as a real patch (diff -u origfile patchedfile).</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=11982008-04-24T09:03:12Zstbuehler
<ul></ul><p>This is of course a more generic problem with all platforms, so i will link them here.</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=52522009-01-22T01:59:26Znecrobious
<ul></ul><p>setting:<br /> server.network-backend = "writev" <br />in my lighthttpd.conf file fixed this for me, tmmv! see (<a class="external" href="http://www.lighttpd.net/2007/2/3/raw-io-performance">http://www.lighttpd.net/2007/2/3/raw-io-performance</a>) for potential impact.</p>
<p>-kirk<br />Solaris 10<br />lighttpd 1.4.19<br />php 5.2</p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=93472016-04-11T09:48:47Zgstrauss
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/987">Bug #987</a>: error:network_freebsd_sendfile.c.175</i> added</li></ul> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=94132016-04-18T07:11:37Zgstrauss
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/9413/diff?detail_id=7402">diff</a>)</li><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Patch Pending</i></li><li><strong>Assignee</strong> deleted (<del><i>jan</i></del>)</li><li><strong>Target version</strong> set to <i>1.4.40</i></li></ul><p>Submitted pull request <a class="external" href="https://github.com/lighttpd/lighttpd1.4/pull/58">https://github.com/lighttpd/lighttpd1.4/pull/58</a></p> Lighttpd - Bug #471: sendfile backends do not fall back to write/writev if they are not supported by the kernelhttps://redmine.lighttpd.net/issues/471?journal_id=95522016-05-02T16:25:09Zgstrauss
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Fixed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="[core] fallback to write if sendfile not supported (fixes #471, #987) x-ref: "sendfile backend..." href="https://redmine.lighttpd.net/projects/lighttpd/repository/14/revisions/c46f0ce027155924a53bf12cb306b3afb77bbd65">c46f0ce027155924a53bf12cb306b3afb77bbd65</a>.</p>