scalable network architectures (was RE: [Mono-list] Mono fitness for ircd project)
Matt Liotta
mliotta@r337.com
Mon, 3 Jun 2002 16:09:15 -0700
Ah, my favorite subject! Cleary select()/poll() based systems fall down
as the number of sockets increases. A perfect example of this is a web
server where handling 20000 sockets is often impossible. This is because
it often takes longer to poll all the 20000 sockets than it does to
respond to a socket's request. There have been a couple of interesting
ways of attacking this problem. The first that comes to mind is
/dev/poll, which originally came from Solaris (I think) and was later
implemented in the Linux kernel. Instead of doing a linear search for
sockets like poll(); /dev/poll/ offers a tree based data structure,
which makes the performance log N. Another approach is to use real-time
signals. Not sure where they came from, but the Linux kernel has an
implementation of this. Real-time signals completely get rid of the
process of looking for sockets that a ready. Instead the kernel notifies
you of which sockets are ready using a signal. With proper kernel
support real-time signals should provide the most scalable network
architecture.
-Matt
> -----Original Message-----
> From: Miguel de Icaza [mailto:miguel@ximian.com]
> Sent: Monday, June 03, 2002 3:57 PM
> To: Matt Liotta
> Cc: mono-list@ximian.com
> Subject: RE: [Mono-list] Mono fitness for ircd project
>
> Hello,
>
> > As someone pointed out to me in a off-list message; it is really
hard to
> > say how well it will scale until you try it. Back when I tried doing
an
> > irc services daemon using Java, the networking library really only
> > offered a one socket per thread type model. As you can imagine, few
> > machines would be able to support 10000 users with this model. As of
> > J2SE 1.4, the networking library for Java has a select like model
that
> > should allow it to scale much better. There is still the issue of
all
> > that string manipulation, but my understanding is that has improved
as
> > well in the Java camp.
>
> This is an interesting comment, and reminded me of more information
from
> my friend's irc server.
>
> The .NET framework (C# being just a front-end to the classes really)
> comes with a select-like model like the one you describe, but it also
> comes with support for asynchronous notifications on I/O, which is
> exactly the model that Jordi needed for his irc server, because he
said
> select()/poll()-based systems were too slow and did not scale.
>
> So maybe we got the best of all worlds ;-)
>
> Miguel