J2SE Server
Hi All
When in college, we did some client server stuff. The server was just a SE application which would spawn a thread for each client as they logged in.
Would this kind of simple approach hold up in the real world, say for example if 2000 clients were logged on could a program / server machine deal with 2000 threads of this kind.
I know it's a very vague question but is this simple approach any less reliable than using a custom server such as Apache if a simple one is sufficient from an objectivity point of view?
Knowo very little about the subject just looking for some enlightenment.
You can with some trickery make it very stable and performant. Depending on your exact requirements (are those connections used for continous data transfer or are you rather using request-response-type communication?) you might be far better of with the existing infrastructure of a application server.
Tomcat for example is written in plain Java and is sufficiently performant for quite taxing applications (if configured correctly).
Cheers for the response guys
> Depending on your exact requirements (are
> those connections used for continous data transfer or
> are you rather using request-response-type
> communication?)
Well, for my purposes it would just be two requests
1) Send me the data please
2). Save this data please.
1 would occur probably once in the program at start up.
2 would occur any time the user were to save data - often probably
I'm worried that: -
1). If too many threads were spawned the server CPU may become over-run.
2). The thing might **** out altogether with too many threads.
Would the likes of Tomcat have some techniques beyond just having each thread waiting for input from it's client for saving on CPU resources?
I have no doubt that the simple version would be fine for a small number of clients I just don't know how it would hold up with large numbers.