Feature #2171
closedSolaris event-ports support
Description
This is a reworked 2-year-old patch of #1147 with only little modifications, diffed against lighttpd 1.4.26.
Solaris Event Ports are currently the best polling mechansim on Solaris 10 and OpenSolaris.
Configuration file:
server.event-handler = "solaris-eventports"
You may change the event handler name to "solaris-port" as in the original patch (but this one is more declarative).
The patch works on my Solaris 10 systems under high load and in comparsion to solaris-devpoll does not eat up a whole CPU core.
If you consider adding this patch to the core, please close issue #1147
Martin Matuska.
Files
Updated by mm over 14 years ago
Running on a busy server (single process) with 4000+ connections, 3000+ requests/sec, 200+Mbit/s traffic.
Server load with poll module: 0.7, with event ports: 0.5 (~50% of one core)
Updated by mm over 14 years ago
From client's perspective connections are handled properly and data is delivered properly.
But when connections are closed, the following appears in the error log:
2010-03-10 11:06:22: (connections.c.1216) connection closed: poll() -> ERR [number]
We can do this in connections.c:
diff -Naur ../lighttpd-1.4.26.orig/src/connections.c ./src/connections.c
--- ../lighttpd-1.4.26.orig/src/connections.c 2010-03-10 11:18:02.173041427 +0100
+++ ./src/connections.c 2010-03-10 11:19:24.161434445 +0100
@@ -1212,7 +1212,7 @@
}
} else if (revents & FDEVENT_ERR) {
-#ifndef USE_LINUX_SIGIO
+#if !defined(USE_LINUX_SIGIO) && !defined(USE_SOLARIS_PORT)
log_error_write(srv, __FILE__, __LINE__, "sd",
"connection closed: poll() -> ERR", con->fd);
#endif
Updated by mm over 14 years ago
Updated by stbuehler over 14 years ago
- Target version changed from 1.4.27 to 1.4.x
Updated by stbuehler over 14 years ago
- Status changed from Patch Pending to Missing Feedback
- Target version deleted (
1.4.x)
I just committed the libev fdevent handler; that should include support for solaris-eventports too.
If you'd still like a native solaris-port handler, please update your patch to:- use log* functions (see other backends) instead of fprintf
- don't include the diffs for generated files like: config.h.in, configure, Makefile.in
Just reopen the bug in that case, thx.
Updated by mm over 13 years ago
- File solaris-eventports.patch solaris-eventports.patch added
- Status changed from Missing Feedback to Reopened
- Assignee set to stbuehler
- Target version set to 1.4.29
I have updated the native eventports patch following your instructions and running it successfully on Solaris 10, OpenSolaris and Nexenta Core.
Updated by Olaf-van-der-Spek over 13 years ago
What's the advantage over using libev?
Updated by stbuehler over 13 years ago
what is the && defined(__sun)
needed for?
Updated by mm over 13 years ago
That is probably remains from the old patch, I don't think it is necessary.
Updated by stbuehler over 13 years ago
Ok, next question: why call port_getn twice?
Updated by stbuehler over 13 years ago
stbuehler wrote:
Ok, next question: why call port_getn twice?
Hm, i think i get that now.
But i don't like the handling of ETIME, according to the man page http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?port_getn+3:
ETIME The time interval expired before the expected number of events have been posted to the port (original value in nget), or nget is updated with the number of returned port_event_t structures in list[].
This doesn't sound like one could rely on nget, or you should at least compare it to the value you provided, and only proceed when they are different.
Updated by stbuehler over 13 years ago
Here the patch i would use; as opensolaris is a pain in the ass i didn't manage to test it.
Updated by mm over 13 years ago
Hi, to compile, the patch is missing a int declaration:
for (i = 0; i < available_events; ++i) {
solaris_port_events = 0;
should be:
for (i = 0; i < available_events; ++i) {
int solaris_port_events = 0;
Second, it doesn't work (lighttpd doesn't server a single file). The previous patch works.
I can do one or more of these things:
a) help you debug this
b) provide you access to a machine with a working build environment
c) provide you with a virtualbox appliance with a working build environment
Thank you for looking at this,
Martin Matuska
Updated by stbuehler over 13 years ago
solaris_ports_events = 0;
can be removed (the var isn't needed, the flags are read from user_data). wait_for_events
should perhaps be initialized to 0.
Apart from that it should work (as long as it compiles).
If it doesn't, well... i guess for all 3 options it would be helpful if you could join #lighttpd@freenode
Whether it works or not, i'm especially interested in compiler warnings :)
Updated by stbuehler over 13 years ago
- Status changed from Reopened to Fixed
- % Done changed from 0 to 100
Applied in changeset r2796.
Also available in: Atom