[MUD-Dev] TECH: Servers in Java

Bobby Martin bobbymartin at hotmail.com
Thu Jan 3 23:16:37 CET 2002


> From: Brian Hook <brianhook at pyrogon.com>

> The first thing I've noticed is that Java's UDP implementation
> doesn't seem to have a non-blocking mode receive().  The apparent
> recommended strategy is to park your receive() on a separate
> thread.  I assume I'll be multiplexing incoming data based on the
> client's IP/port combo, as opposed to some proposals of forking
> off a new thread per client (which would obviously not be tenable
> with, say, 2000 clients).
 
> Other issues include the robustness of the various JVM
> implementations and the usability/predictability of Java GC
> implementations (that's a real big unknown for me -- is Java's GC
> going to be bad enough that it will affect a server's
> reliability?).
 
> If anyone has first hand experience on this, I'd love to hear
> about it.  I've done some cursory examination of the archives and
> haven't found much.
 
> In case it's relevant, my final target will likely be FreeBSD 4.x
> on Intel.

Cosm, both client and server, are written in Java.  Yup, there's no
non-blocking method to pick up UDP messages in Java as of JDK1.3.
There is a new io package (java.nio.*) in JDK 1.4 that provides this
service.

May I suggest that you look into ARMI on SourceForge?  We spun it
off as an open source project from Cosm.  It's our messaging system;
essentially it's a faster and more lightweight RMI with support for
asynchronous method calls.  Right now it uses TCP with one thread
per client (big yuck) and can be trivially swapped out to use UDP
with no order or delivery guarantees (big yuck) but after JDK1.4
moves out of beta we'll be changing it to use the nio package so we
can do single threaded support of multiple TCP sockets.  We're also
going to test our own implementation of TCP on top of Java UDP and
go with whatever has better performance.  The interface shouldn't
change when we change the underlying messaging system, so you can
test for now with a limited number of clients and it will support
massive numbers of clients before you ever have need of them.

Regarding garbage collection, so far it hasn't been a problem at
all, but I have yet to test with more than ~30 clients.

Bobby
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list