Re: Millions of Threads ?



frankgerlach@xxxxxxxxx wrote:

I am thinking about a telecom application, which would potentially
handle millions of mobile
phones (J2ME) as clients. Of course, I need a server (J2SE), too.
The "easy" implementation uses TCP connections for the client/server
communication. Problem is that there are only 65000 sockets per IP
address of the server. I think I could solve that by configuring
multiple IP addresses per network card.

Assuming < 10e6 customers, and average of 10 messages per day, and a target
turn-around time of 0.5 seconds, that suggests that you would have an average
of around 600 interactions "in-flight" at any one instant. Obviously you would
have to model/estimate how much the peak load would exceed that. That suggests
that running out of port numbers is not going to be one of your problems.

Still, two problems remain: Memory used by each TCP connection and by
the enormous number of threads (each client would have a server thread
for the "easy" implementation)

On most OSs each thread consumes a lot of resource -- the stack space for
instance. It also puts load on the scheduler. Don't use that many threads
unless either your JVM is specifically designed to handle that many threads as
lightweight entities (Sun's are not), or your OS is specifically designed to
provide ultra light-weight threads (I believe that there is a Linux threads
implementation which claims to have this property -- I have no experience of it
at all myself).

Otherwise, that many concurrent requests puts you squarely into NIO territory.
Then scale up your CPUs and/or load-balanced server boxes to make the target
turn-around time achievable. Same goes for the database (if any).

Notice that, on the above assumptions, you will be serving a request at
intervals of (on average) about 1 millisecond. That is substantially less than
the typical disk-seek time. If each request causes one disk read, and if there
is not enough temporal correlation between requests (which there might be),
then each request will also cause one physical disk seek -- so you need
sufficient spindles to allow that many seeks to be issued without blocking each
other.

-- chris


.



Relevant Pages

  • RE: process starvation with 2.6 scheduler
    ... The network traffic is of request response type. ... The netperf clients run on an external box, ... A client sends request to a server, ... With an ICE connected to the Palladium (emulator) I have dumped the kernel data structures of the starved process and the active process. ...
    (Linux-Kernel)
  • Re: VB6 Winsock action on Server
    ... my usage of server app I meant the app on the server ... It is this piece 'dll' that i ... to delegate each request to a separate instance ... back to your Clients directly from *inside* the WorkerThreads, ...
    (microsoft.public.vb.general.discussion)
  • Re: HTTP tunneling and Servlet communication
    ... almost definitely be behind a firewall/using a proxy server. ... I have come up with a class which acts as a Facade to clients and presents a course simpler request/response API to clients. ... I am not sure how to convert my method call into an HTTP request. ... Can I send request/responses AND data on the same tunnel?. ...
    (comp.lang.java.programmer)
  • Re: DHCP basic question - turning on scope of same range?
    ... The Clients always request the same number they ... I've juggled DHCP Servers around here a few times and I only ... It would> be a good idea after the change to have the clients release and renew their> addresses. ... I have configured a DHCP scope of the same IP>> range on a W2K server and would like to simply shut off ...
    (microsoft.public.win2000.networking)
  • [REVS] NTLM HTTP Authentication is Insecure By Design
    ... in front of a web server, and that proxy server shares a single TCP ... These are attacks that make use of non-RFC HTTP requests (HTTP Request ... the authentication is associated with the ...
    (Securiteam)

Loading