Network Programming

Hi Folks,

    I am in the process of writing a network server that'd cater to 10,000 clients(scalable to 20000)
My main target is reliability with speed.
I am using sockets using tcp  & udp .

And need to design a simulator to simulate 10000 client connections.
Has anyone designed it so far if not how to go about doing it
Is it possible to do this using vc# alone or do I need something else too.

Another question off ma head:
what is the fastest way to write into an sql server table something that's streaming data live.

eg. a server broadcasting datapackets with huge density to an application & which needs to store it into a database.[sql server 2000]
 

Thanks in advance,



Answer this question

Network Programming

  • Revlisoft

    Hi,

    It's pretty hard to scale with TCP because the protocol is not connectionless. UDP is a far better choice for speed and you can do some workaround for the reliability part. The problem with the network servers resides in the server side processing. Usually you can have requests which have different grades of priority. In this case you can't use the thread pool (because the threads have a fixed "Normal" priority) so you are better by using a "custom made" thread pool for processing.
      If you don't have priorities than it preety easy....use the thread pool and cache the request for thread pool precessing.

    Cheers,
    Marius Gheorghe
    www.voidsoft.ro



  • rotest

    Hi Karthik,

    There are numerous load generator applications available that you may want to research before deciding to write your own client simulator.  A search on search.msn.com for "network load generator" would be a good place to start.  Yes, you could build a load generator using System.Net and c#.  In order to get the best scalability possible you will want to investigate the asynchronous calls avaialbe in the System.Net.Sockets namespace.

  • B Letts

    It sounds to me that when making your client load generator you are staring a new process for every client connection you are trying to simulate.  Is this correct   If so, as mentioned above, you should look into the asynchronous API calls available (BeginXXX, EndXXX).  This way you can make a lighter weight solution with one process and multiple async calls. 

    You may want to read the following articles:

    Async Server sockets:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpguide/html/cpconusingnon-blockingserversocket.asp

    Async Client Sockets:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpguide/html/cpconusingnon-blockingserversocket.asp



  • Michael.Weinhardt - MSFT

    Hey Mike,

           Thanks for the suggestion. To start off with , I used a process.start under the system.diagnostics namespace and used it to start off the test syncronous client executable a thousand times so that I can check if the simple synchronous server takes it. Well The server takes upto 5 mb ram under such circumstances. I shall lookup asynchronous client - server options & also load generator samples to replace that process.start option as you said. I just wanted to know that I am heading the right way and I guess I am as per your reply.

    Thanks again,
    Have a nice day.

  • Paulo_Amaral

    Hi Marius,

    Thanks for that information, well currently I am using the threadpool managed by system. And am waiting to reach the performance limits with this setup before I go to create a thread pool on my own to boost the performance.



  • Network Programming