<br><div class="gmail_quote">2008/7/2 Perry E. Metzger <<a href="mailto:perry@piermont.com">perry@piermont.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
"Robert G. Brown" <<a href="mailto:rgb@phy.duke.edu">rgb@phy.duke.edu</a>> writes:<br>
>> Well, it actually kind of is. Typically, a box in an HPC cluster is<br>
>> running stuff that's compute bound and who's primary job isn't serving<br>
>> vast numbers of teeny high latency requests. That's much more what a<br>
>> web server does. However...<br>
><br>
> I'd have to disagree.  On some clusters, that is quite true.  On others,<br>
> it is very much not true, and whole markets of specialized network<br>
> hardware that can manage vast numbers of teeny communications requests<br>
> with acceptably low latency have come into being.  And in between, there<br>
> is, well, between, and TCP/IP at gigabit speeds is at least a contender<br>
> for ways to fill it.<br>
<br>
I have to admit my experience here is limited. I'll take your word for<br>
it that there are systems where huge numbers of small, high latency<br>
requests are processed. (I thought that teeny stuff in HPC land was<br>
almost always where you brought in the low latency fabric and used<br>
specialized protocols, but...)<br>
<br>
>> Myself, I'm a believer in event driven code. One thread, one core. All<br>
>> other concurrency management should be handled by events, not by<br>
>> multiple threads.[....]<br>
</blockquote><div><br>libevent can be used for event-based servers.<br>
<a href="http://www.monkey.org/~provos/libevent/">http://www.monkey.org/~provos/libevent/</a><br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
> Interesting.  Makes sense, but a lot of boilerplate code for daemons has<br>
> always used the fork approach.  Of course, things were "smaller" back<br>
> when the approach was dominant.  The forking approach is easy to program<br>
> and reminiscent of pipe code and so on.</blockquote><div><br>This site describe several approaches to solve this problem:<br>
<a href="http://www.kegel.com/c10k.html">http://www.kegel.com/c10k.html</a><br> <br>Look for <a name="x15">Chromium's</a> X15. It can handle thousands of simultaneous conections and can saturate gigabit networks even with lots of slow clients.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Sure, but it is way inefficient. Every single process you fork means<br>
another data segment, another stack segment, which means lots of<br>
memory. Every process you fork also means that concurrency is achieved<br>
only by context switching, which means loads of expense on changing<br>
MMU state and more. Even thread switching is orders of magnitude worse<br>
than a procedure call. Invoking an event is essentially just a<br>
procedure call, so that wins big time.</blockquote><div><br>As fas I know, process creation can take up to 1,000,000 cycles.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
Event driven systems can also avoid locking if you keep global data<br>
structures to a minimum, in a way you really can't manage well with<br>
threaded systems. That makes it easier to write correct code.<br>
<br>
The price you pay is that you have to think in terms of events, and<br>
few programmers have been trained that way.<br>
<br>
Perry<br>
<font color="#888888">--<br>
Perry E. Metzger                <a href="mailto:perry@piermont.com">perry@piermont.com</a><br>
_______________________________________________<br>
Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a><br>
To change your subscription (digest mode or unsubscribe) visit <a href="http://www.beowulf.org/mailman/listinfo/beowulf" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
</font></blockquote></div><br>