[JDEV] scaling a single server?

Jacob O'Reilly jacob at clear.net.nz
Fri Feb 4 21:15:50 CST 2000


-----Original Message-----
From: Dave Smith <dsmith at ai.uwf.edu>
To: jdev at jabber.org <jdev at jabber.org>
Date: Saturday, 5 February 2000 11:34
Subject: Re: [JDEV] scaling a single server?


>Err..this isn't true (to the best of my knowledge). There are only 65536
>ports available for *listening* on most BSD socket impls. When a TCP
>connection arrives it doesn't stay on the port it initally connects on.
>Instead, the IP stack does some magic and the connection is diverted to a
>"pseudo-port" (if you will) that handles the connection from then on. Thus,
>you can have many more actualy socket connections than port numbers
>(assuming your kernel is setup to handle it). At least, this is my
>understanding of the matter... :)

Actually, when you listen() for an incoming connection, you are returned a
new socket with a system-supplied port number.  When you have a socket on
that port, you cannot bind to it with another socket.

I think the key is the architecture, though.  This includes the target
operating systems, the networks, the client requirements as well as the
internals of the software.

I would imagine a star-type architecture would allow the most users.  Given
that most users are not utilizing the server in any given second.  Your
server component would not need much in the way of CPU resources.  Multiple
servers handle the connections of clients (in the way terminal servers used
to for terminals -- long live P9s!) and multiplex the actual load down into
a more manageable number of connections to the server.

Alternately, you could get the kernel to handle 25K connections.  This still
doesn't completely solve the problem, though.  25k clients all sending ICMP
packets might not be so good for the server.  Remember that in the real
world (of business anyway!) at 8.30am (or whenever) users sign-on -- at
around the same time.  That means you should be able to handle a peak load
of much closer to your total user-base than you would need during the day.
It would also make sense for the access-point server to handle some of the
more mundane logic -- authentication, validation of input.

That said, I've not seen anything that would/should stop Jabber scaling that
well.  It just takes someone to do it!

Btw, I'm amazed at how much has been accomplished by you guys, maybe I've
just had bad experiences, but the projects I usually follow tend to fall to
pieces before any code is written.

Regards,
Jacob.







More information about the JDev mailing list