1999Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] How to support 1000+ simultaneous connections, and some philosophy. -->
<!--X-From-R13: Pra Uerrne <terrneNploreuvtujnl.arg> -->
<!--X-Date: Wed, 10 Mar 1999 19:19:02 &#45;0800 -->
<!--X-Message-Id: 36E72EFE.8C7C010C#cyberhighway,net -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.96.990310191119.559A&#45;100000#agrajag,internal -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] How to support 1000+ simultaneous connections, a</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:greear#cyberhighway,net">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00523.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00525.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00515.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00527.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00524">Author</A>
&nbsp;|&nbsp;<A HREF="#00524">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00524">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</LI>
<LI><em>From</em>: Ben Greear &lt;<A HREF="mailto:greear#cyberhighway,net">greear#cyberhighway,net</A>&gt;</LI>
<LI><em>Date</em>: Wed, 10 Mar 1999 19:48:30 -0700</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:greear#burrito,cyberhighway.net">greear#burrito,cyberhighway.net</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Oliver Jowett wrote:
&gt; 
&gt; On Tue, 9 Mar 1999, Ben Greear wrote:
&gt; 
&gt; &gt; It looks like you'd want one program sitting on your well known
&gt; &gt; port, accepting connections.  It could be attached to the 'real'
&gt; &gt; server via a single socket or pipe.  A trivial packet encapsulation
&gt; &gt; with a unique ID as far as the main server is concerned should
&gt; &gt; work just fine.
&gt; &gt;
&gt; &gt; However, I wonder what to do when the accepting server on the
&gt; &gt; well known port is full?  One thing would be for it to quit
&gt; &gt; listening and spawn a new process on that well known port?
&gt; &gt;
&gt; &gt; That works for a while, but then how do you re-use this detached
&gt; &gt; server when it's load goes down again?
&gt; &gt;
&gt; &gt; Anyone know how Apache does it?
&gt; 
&gt; Apache appears to use a mutex to make sure that only one child is
&gt; attempting to select on the accepting socket at once (it's set up once, in
&gt; the parent).  This isn't really the same as the problem here since we
&gt; don't want to completely block the child servers..
&gt; 
&gt; Perhaps something like:
&gt; 
&gt; - Parent sets up accepting socket on well-known port
&gt; 
&gt; - Parent does the select() on the accepting socket. When a connection is
&gt;   ready to be accepted, it picks a free child and sends it a control
&gt;   message to that child saying "accept a connection now".
&gt; 
&gt; - When a child gets this message, it calls accept() on the accepting
&gt;   socket and starts handling that connection.

Sounds great, but I know of no way to implement this.  Don't think you
can
pass descriptors around from process to process.

&gt; 
&gt; - If the parent finds there are no free children, it starts a new one
&gt;   (inheriting the common accepting socket)
&gt; 
&gt; - When a child gets full, it sends a message to the parent saying "no more
&gt;   connections for me please". When it gets space again, it sends the
&gt;   opposite message. The parent keeps track of which children are free
&gt;   to accept new connections based on these messages.
&gt; 
&gt; - If a child gets a "accept a connection" message and it's full, it sends
&gt;   an appropriate message to the server to farm it out again (this is
&gt;   possible if the "I'm full" message didn't arrive in time)
&gt; 
&gt; Might work. This would also let you balance the connection load between
&gt; several children (assuming the children do a bit more than just
&gt; en/decapsulate and pass on data)

I want one main program doing all the work, and potentially many small,
stupid
servers accepting and MUX/DEMUXing data to the main server.  Thus the
main
server has few descriptors (just pipes/sockets) to the stupid acceptor
servers.


Of course, other option is to run on multiple ports and write a custom
client
that knows how to negotiate a handoff.

&gt; 
&gt; -O
&gt; 
&gt; _______________________________________________
&gt; MUD-Dev maillist  -  MUD-Dev#kanga,nu
&gt; <A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>

-- 
Ben Greear (greear#cyberhighway,net)  <A  HREF="http://www.primenet.com/~greear">http://www.primenet.com/~greear</A> 
Author of ScryMUD:  mud.primenet.com 4444        (Released under GPL)
<A  HREF="http://www.primenet.com/~greear/ScryMUD/scry.html">http://www.primenet.com/~greear/ScryMUD/scry.html</A>


_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00527" HREF="msg00527.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>
<ul compact><li><em>From:</em> Oliver Jowett &lt;icecube#ihug,co.nz&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00515" HREF="msg00515.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></STRONG>
<UL><LI><EM>From:</EM> Oliver Jowett &lt;icecube#ihug,co.nz&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00523.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00525.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00515.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00527.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00524"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00524"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00513" HREF="msg00513.html">[MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Wed 10 Mar 1999, 05:33 GMT
<UL>
<LI><strong><A NAME="00514" HREF="msg00514.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Matthew D. Fuller <a href="mailto:fullermd#futuresouth,com">fullermd#futuresouth,com</a>, Wed 10 Mar 1999, 05:56 GMT
<UL>
<LI><strong><A NAME="00523" HREF="msg00523.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Thu 11 Mar 1999, 03:14 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00515" HREF="msg00515.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Oliver Jowett <a href="mailto:icecube#ihug,co.nz">icecube#ihug,co.nz</a>, Wed 10 Mar 1999, 06:50 GMT
<UL>
<LI><strong><A NAME="00524" HREF="msg00524.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Thu 11 Mar 1999, 03:19 GMT
<UL>
<LI><strong><A NAME="00527" HREF="msg00527.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Oliver Jowett <a href="mailto:icecube#ihug,co.nz">icecube#ihug,co.nz</a>, Thu 11 Mar 1999, 04:23 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00519" HREF="msg00519.html">[MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Petri Virkkula <a href="mailto:pvirkkul#iki,fi">pvirkkul#iki,fi</a>, Thu 11 Mar 1999, 00:40 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00516" HREF="msg00516.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Wed 10 Mar 1999, 14:47 GMT
<UL>
<LI><strong><A NAME="00525" HREF="msg00525.html">Re: [MUD-Dev] How to support 1000+ simultaneous connections, and some philosophy.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Thu 11 Mar 1999, 03:24 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>