Scalable socket server

K

Kürþat

Hi,

I am working on a configuration distribution application. The application
will be running on a central server box and priodically distribute some
parameters to its clients via a TCP connection.For each client, server
application will send some parameters and wait for a response or timeout.

The application should work with 1500-4000 clients at the same time. It
should be multithreaded but -I think-not 4000 threaded:)

The question is how should I design that application to make it scalable,
responsive and concurrent. Any idea, code sample, document, link will be
appreciated.

Thanks in advance.
 
K

Kevin Spencer

I would suggest that you set up your distribution application as a service,
and have the clients ping the app periodically to find out if updates are
available. The app would therefore be run as a service, listening for and
responding to the pings. This is the way this sort of thing is typically
handled. There is never a guarantee that a client will be available.
Therefore the app cannot possibly update all clients at the same time. It is
logical, therefore, that the client should ping for updates. If the data is
critical to synchronization of the clients, it should be in one place, on a
service, rather than distributed across many clients.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
C

Chris Mullins [MVP]

I know a little bit out scalable socket servers built with .Net, and have
written quite a bit about them in the past.

Some of the more relevant stuff I've written can be found at:

Architectures for a scalable socket app:
http://www.coversant.net/Default.aspx?tabid=88&EntryID=10

Don't use the system thread pool in your socket app:
http://www.coversant.com/Default.aspx?tabid=88&EntryID=36

Use Object Pools to prevent heap fragmentation, or you're screwed:
http://www.coversant.com/Default.aspx?tabid=88&EntryID=36
 
K

Kürþat

Hi Kevin,

Your solution is what we need in normal conditions but we work on to
implement an official protocol so it is impossible to change the way clients
and server communicate.
 
C

Chris Mullins [MVP]

At this point in time, you would be crazy to build your own signaling
protocol.

There already exists a standard for this, and it's excellent for data
exchange, is flexible in the extreme, and has broad support across all
current platforms.

Spend some time reading about XMPP, and the various extensions available for
it.
 
K

Kürþat

Hi Chris,

First of all, thanks for the links to your great articles. I keep reading
them and also start to read about XMPP.

We are not define a protocol from scrach, we just want to implement an
existing protocol and it says:"Server sends config data to registered
clients using TCP connections and waits their response."
So it will be:
[send_client_1 - receive_client_1]-[send_client_2 - receive_client_2]...

But we do not want it to be serial, we do want to process as much concurrent
connections as possible. So our application should start sending config data
to all clients in a loop. If any response arrives while sending continue, it
should be processed without inturrupting(OK, contex switching is accepted
:))) the send operation.
 
K

Kürþat

Hi Chris,

What is the best way to measure performans of such an application. How can
we do heavy load tests?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top