MOO-cows Mailing List Archive


Re: max connection limit?

On Sun, 13 Oct 1996, Jacqueline Hamilton wrote:

> Anyone know what the max connection limit is to a MOO?  256 or so?  Or is
> it possible at all to go higher?  Is this system-dependent or
> MOO-dependent (or both)?

It's OS-dependant.  I tested it on a few machines.  It appears to be:
256 on SunOS 4.1.4
1024 on SunOS 5.5.1
1024 on HP-UX 9.05
(64 on ULTRIX 4.1, if anyone cares.)

I didn't have a Linux box to test.

Presumably this is higher on newer commercial UNIXes, to allow
high-powered Web servers to run.  It's also possibly configurable in the
kernel--if that helps (which it might for Linux.)

The limit is on the highest integer that can be a valid file descriptors.
File descriptors are used both for network connections and files (like the
checkpoint files) -- so the limit on connections is a few less than 256,
since the MOO uses a couple pipes for name-lookups, a database
checkpointer, and keeps a couple "in its pocket" to notify users when it's
out of file descriptors.

The following short C program will tell you the current maximum, and hard
maximum number of simultaneously open file descriptors... on many systems:


#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

int main
	struct rlimit rlp;

	getrlimit(RLIMIT_NOFILE, &rlp);

	printf("File descriptor limits:\n");
	printf("Current limit: %d\n", rlp.rlim_cur);
        printf("Maximum limit: %d\n\n", rlp.rlim_max);

	return 0;


> Also... hmm.  What if you had the MOO listening on multiple ports?  Is the
> connection limit still there?  How about web connections vs. normal telnet
> connections?  

Multiple ports won't help, and web connections are no different except
that they usually last only a short time.  All connections count towards
the same limit.

The server could conceivably be modifed to use multiple processes to do
network input and output, and thereby avoiding a per-process
filedescriptor limit by listening on different ports in different
processes.  This wouldn't be trivial but the MOOserver-network interface
is designed well enough that it wouldn't be unnecessarily difficult.  This
could also (possibly) benefit the MOOserver in speed if the machine in
question had multiple processors (don't we all wish) but would probably
slow it down somewhat in most cases by adding some extra overhead.

    ResComp Network Support Technician, Bursley Hall
    "Invisibility is in the eye of the beholder."
    Home Page:

Follow-Ups: References:

Home | Subject Index | Thread Index