https://redmine.lighttpd.net/https://redmine.lighttpd.net/favicon.ico?13667327412010-03-10T10:16:43Zlighty labsLighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68292010-03-10T10:16:43Zmm
<ul></ul><p>Running on a busy server (single process) with 4000+ connections, 3000+ requests/sec, 200+Mbit/s traffic.<br />Server load with poll module: 0.7, with event ports: 0.5 (~50% of one core)</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68302010-03-10T11:12:50Zmm
<ul></ul><p>From client's perspective connections are handled properly and data is delivered properly.</p>
<p>But when connections are closed, the following appears in the error log:<br />2010-03-10 11:06:22: (connections.c.1216) connection closed: poll() -> ERR [number]</p>
<p>We can do this in connections.c:</p>
<pre><code class="c syntaxhl" data-language="c"><span class="n">diff</span> <span class="o">-</span><span class="n">Naur</span> <span class="p">..</span><span class="o">/</span><span class="n">lighttpd</span><span class="o">-</span><span class="mi">1</span><span class="p">.</span><span class="mi">4</span><span class="p">.</span><span class="mi">26</span><span class="p">.</span><span class="n">orig</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">connections</span><span class="p">.</span><span class="n">c</span> <span class="p">.</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">connections</span><span class="p">.</span><span class="n">c</span>
<span class="o">---</span> <span class="p">..</span><span class="o">/</span><span class="n">lighttpd</span><span class="o">-</span><span class="mi">1</span><span class="p">.</span><span class="mi">4</span><span class="p">.</span><span class="mi">26</span><span class="p">.</span><span class="n">orig</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">connections</span><span class="p">.</span><span class="n">c</span> <span class="mi">2010</span><span class="o">-</span><span class="mo">03</span><span class="o">-</span><span class="mi">10</span> <span class="mi">11</span><span class="o">:</span><span class="mi">18</span><span class="o">:</span><span class="mo">02</span><span class="p">.</span><span class="mi">173041427</span> <span class="o">+</span><span class="mo">0100</span>
<span class="o">+++</span> <span class="p">.</span><span class="o">/</span><span class="n">src</span><span class="o">/</span><span class="n">connections</span><span class="p">.</span><span class="n">c</span> <span class="mi">2010</span><span class="o">-</span><span class="mo">03</span><span class="o">-</span><span class="mi">10</span> <span class="mi">11</span><span class="o">:</span><span class="mi">19</span><span class="o">:</span><span class="mi">24</span><span class="p">.</span><span class="mi">161434445</span> <span class="o">+</span><span class="mo">0100</span>
<span class="err">@@</span> <span class="o">-</span><span class="mi">1212</span><span class="p">,</span><span class="mi">7</span> <span class="o">+</span><span class="mi">1212</span><span class="p">,</span><span class="mi">7</span> <span class="err">@@</span>
<span class="err">}</span>
<span class="err">}</span> <span class="k">else</span> <span class="nf">if</span> <span class="p">(</span><span class="n">revents</span> <span class="o">&</span> <span class="n">FDEVENT_ERR</span><span class="p">)</span> <span class="p">{</span>
<span class="o">-</span><span class="err">#</span><span class="n">ifndef</span> <span class="n">USE_LINUX_SIGIO</span>
<span class="o">+</span><span class="err">#</span><span class="k">if</span> <span class="o">!</span><span class="n">defined</span><span class="p">(</span><span class="n">USE_LINUX_SIGIO</span><span class="p">)</span> <span class="o">&&</span> <span class="o">!</span><span class="n">defined</span><span class="p">(</span><span class="n">USE_SOLARIS_PORT</span><span class="p">)</span>
<span class="n">log_error_write</span><span class="p">(</span><span class="n">srv</span><span class="p">,</span> <span class="n">__FILE__</span><span class="p">,</span> <span class="n">__LINE__</span><span class="p">,</span> <span class="s">"sd"</span><span class="p">,</span>
<span class="s">"connection closed: poll() -> ERR"</span><span class="p">,</span> <span class="n">con</span><span class="o">-></span><span class="n">fd</span><span class="p">);</span>
<span class="cp">#endif
</span></code></pre> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68312010-03-10T14:54:21Zmm
<ul><li><strong>File</strong> <a href="/attachments/1116">solaris-eventports-1.4.26.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1116/solaris-eventports-1.4.26.diff">solaris-eventports-1.4.26.diff</a> added</li></ul> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68332010-03-15T00:25:53Zmm
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Patch Pending</i></li></ul> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68952010-04-26T21:01:41Znitrox
<ul><li><strong>Missing in 1.5.x</strong> changed from <i>No</i> to <i>Yes</i></li></ul> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=68982010-04-28T15:00:10Zstbuehler
<ul><li><strong>Target version</strong> changed from <i>1.4.27</i> to <i>1.4.x</i></li></ul> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=71662010-08-07T13:04:56Zstbuehler
<ul><li><strong>Status</strong> changed from <i>Patch Pending</i> to <i>Missing Feedback</i></li><li><strong>Target version</strong> deleted (<del><i>1.4.x</i></del>)</li></ul><p>I just committed the libev fdevent handler; that should include support for solaris-eventports too.</p>
If you'd still like a native solaris-port handler, please update your patch to:
<ul>
<li>use log* functions (see other backends) instead of fprintf</li>
<li>don't include the diffs for generated files like: config.h.in, configure, Makefile.in</li>
</ul>
<p>Just reopen the bug in that case, thx.</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=74292011-03-13T19:46:52Zmm
<ul><li><strong>File</strong> <a href="/attachments/1263">solaris-eventports.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1263/solaris-eventports.patch">solaris-eventports.patch</a> added</li><li><strong>Status</strong> changed from <i>Missing Feedback</i> to <i>Reopened</i></li><li><strong>Assignee</strong> set to <i>stbuehler</i></li><li><strong>Target version</strong> set to <i>1.4.29</i></li></ul><p>I have updated the native eventports patch following your instructions and running it successfully on Solaris 10, OpenSolaris and Nexenta Core.</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=74302011-03-14T01:14:37ZOlaf-van-der-Spek
<ul></ul><p>What's the advantage over using libev?</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75132011-06-13T10:00:12Zstbuehler
<ul></ul><p>what is the <code>&& defined(__sun)</code> needed for?</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75142011-06-13T11:09:41Zmm
<ul></ul><p>That is probably remains from the old patch, I don't think it is necessary.</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75152011-06-13T11:21:28Zstbuehler
<ul></ul><p>Ok, next question: why call port_getn twice?</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75162011-06-13T11:46:58Zstbuehler
<ul></ul><p>stbuehler wrote:</p>
<blockquote>
<p>Ok, next question: why call port_getn twice?</p>
</blockquote>
<p>Hm, i think i get that now.</p>
<p>But i don't like the handling of ETIME, according to the man page <a class="external" href="http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?port_getn+3">http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?port_getn+3</a>:</p>
<pre>
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[].
</pre>
<p>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.</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75192011-06-13T14:35:34Zstbuehler
<ul><li><strong>File</strong> <a href="/attachments/1279">fdevent-add-solaris-eventports.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/1279/fdevent-add-solaris-eventports.patch">fdevent-add-solaris-eventports.patch</a> added</li></ul><p>Here the patch i would use; as opensolaris is a pain in the ass i didn't manage to test it.</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75212011-06-13T16:09:18Zmm
<ul></ul><p>Hi, to compile, the patch is missing a int declaration:<br /> for (i = 0; i < available_events; ++i) {<br /> solaris_port_events = 0;<br />should be:<br /> for (i = 0; i < available_events; ++i) {<br /> int solaris_port_events = 0;</p>
<p>Second, it doesn't work (lighttpd doesn't server a single file). The previous patch works.</p>
<p>I can do one or more of these things:<br />a) help you debug this<br />b) provide you access to a machine with a working build environment<br />c) provide you with a virtualbox appliance with a working build environment</p>
<p>Thank you for looking at this,<br />Martin Matuska</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75222011-06-13T16:20:17Zstbuehler
<ul></ul><p><code>solaris_ports_events = 0;</code> can be removed (the var isn't needed, the flags are read from user_data). <code>wait_for_events</code> should perhaps be initialized to 0.</p>
<p>Apart from that it should work (as long as it compiles).</p>
<p>If it doesn't, well... i guess for all 3 options it would be helpful if you could join #lighttpd@freenode</p>
<p>Whether it works or not, i'm especially interested in compiler warnings :)</p> Lighttpd - Feature #2171: Solaris event-ports supporthttps://redmine.lighttpd.net/issues/2171?journal_id=75232011-06-13T19:35:05Zstbuehler
<ul><li><strong>Status</strong> changed from <i>Reopened</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 r2796.</p>