Project

General

Profile

Actions

Feature #2171

closed

Solaris event-ports support

Added by mm over 14 years ago. Updated over 13 years ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
ASK QUESTIONS IN Forums:

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

solaris-eventports-1.4.26.diff (16.2 KB) solaris-eventports-1.4.26.diff Event Ports support for 1.4.26 mm, 2010-03-10 00:31
solaris-eventports-1.4.26.diff (16.7 KB) solaris-eventports-1.4.26.diff Updated Event Ports patch for 1.4.26 mm, 2010-03-10 14:54
solaris-eventports.patch (10.6 KB) solaris-eventports.patch mm, 2011-03-13 19:46
fdevent-add-solaris-eventports.patch (9.9 KB) fdevent-add-solaris-eventports.patch stbuehler, 2011-06-13 14:35

Related issues 1 (0 open1 closed)

Related to Feature #1147: Solaris Event PortsFixedActions
Actions #1

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)

Actions #2

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
Actions #4

Updated by mm over 14 years ago

  • Status changed from New to Patch Pending
Actions #5

Updated by nitrox over 14 years ago

  • Missing in 1.5.x changed from No to Yes
Actions #6

Updated by stbuehler over 14 years ago

  • Target version changed from 1.4.27 to 1.4.x
Actions #7

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.

Actions #8

Updated by mm over 13 years ago

I have updated the native eventports patch following your instructions and running it successfully on Solaris 10, OpenSolaris and Nexenta Core.

Actions #9

Updated by Olaf-van-der-Spek over 13 years ago

What's the advantage over using libev?

Actions #10

Updated by stbuehler over 13 years ago

what is the && defined(__sun) needed for?

Actions #11

Updated by mm over 13 years ago

That is probably remains from the old patch, I don't think it is necessary.

Actions #12

Updated by stbuehler over 13 years ago

Ok, next question: why call port_getn twice?

Actions #13

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.

Actions #14

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.

Actions #15

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

Actions #16

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 :)

Actions #17

Updated by stbuehler over 13 years ago

  • Status changed from Reopened to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2796.

Actions

Also available in: Atom