• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serving multiple client requst.  RSS feed

 
shan raj
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

My requirement is connect 5000 client to server either TCP/UDP protocol for serving the client request. So I thought of creating multithread to handle the client request. But it will not scale and lead into performance issue. Please suggest me any idea on archiving this like using distributed environment.

One more thing the client is already written to connect to the server using TCP or UDP protocol. Only we need to write Server to do service the request.

To archive the distributed environment created a proxy server to accept the connection and send the socket object to free server(Similar as redirecting the URL to some other server in Internet). But the socket is not allowed sending to other process for responding/servicing the particular client request.

Please let me know if you need any other information.

Thanks in Advance !
Shan
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shan raj wrote: But it will not scale and lead into performance issue.


Interesting. That's pretty much the standard way to handle multiple clients. Have a look at this tutorial.
You also have the option of using non-blocking sockets, which means you do not have to create a unique thread to handle each individual client. You'll still need multiple threads to process active sockets simultaneously.
 
Sandeep Kumar Jakkaraju
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is still a limitation on the number of clients per server socker which is 50 ,.... and also depending on OS !!!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandeep Kumar Jakkaraju wrote:There is still a limitation on the number of clients per server socker which is 50

There is?
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seem to remember there are limitations on server functions in certain versions of windows, like Windows Home and if you don't register via WGA, but I can't find a reference.
There are limitations placed by the OS on open sockets and files on a per-process basis. In Linux, the default IIRC is 1024 descriptors (both file and socket) per process, but one can override that setting.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!