Search code examples
c#sql-serverserverasyncsocketdistributed-system

How to distribute the server Load


I'm trying to get my head around this...

I have an application composed of one Server(basically a N tier console application with TCP Async socket programming in C#), One MSSQL database and several clients.

Now the problem is thousands of clients is connecting to this server at the same time and server is not responding efficiently.I want to make this server as distributed and scalable to distribute the clients load.

I'm trying to figure out if there's solution to this problem.Any convenient solution is highly appreciable.

Thanks in advance...


Solution

  • You are a but slim on details, and this is not a drop-in solution: but I always steer clear of load balancers ( central point of failure, and you can only efficiently use the one datacenter or region ).

    The client is the load balancer

    instead, have a central endpoint to list the farmed servers, and then have the client randomly select a server to use for an amount of time. That selected server can then specialise on serving resources for that client, copying data from remote server(s) locally, if not already.

    This selected server would be the master for that client, data would be created there and replicated to other servers later if the client changes server.

    With such a distributed setup your servers can be deployed anywhere in the world generically. So your clients also get better latency and you can find the best priced hosting without being tied to a load balancer.

    Container Clustering

    You'll find clustering like coreos interesting but much more complicated to setup. But don't rule it out. For such a simple console application, it's not that hard to tweak your solution and control your own simpler scalable infrastructure with no extra layers of obscurity.