Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to handle up to 100k HTTP connections in .Net
    primarykey
    data
    text
    <p>I am creating a server to monitor the online presence of clients on a webpage.</p> <ul> <li>There will be 80-100 000 (eighty thousand) simultaneous clients to monitor.</li> <li>I’m using .Net to write this.</li> </ul> <p>Clients will contact a (separate) server using JavaScript (on the HTML-page) to tell the server that they are alive/online.</p> <p>I’m considering one of two approaches:</p> <ol> <li><p>Persistent connections with keep-alive sent regularly. This will give me much higher precision on when clients disconnect and I don’t need to update memory structure (onlineinfo) too often because we know when client comes and goes. Additional benefits to network equipment / bandwidth.</p></li> <li><p>Clients (re)connect at intervals to tell server they are alive. This requires a lot of connections and will necessarily decrease the accuracy. I imagine intervals like 2-3 minutes is the best we can do. 80k/120=660 connections per second… ASP.Net don’t execute too fast so I’m unsure about this. 8 core system = ~10 ms per execution.</p></li> </ol> <p>With this many connections there are obviously some limitations. I can’t spawn that many threads simultaneously for instance. 1 request to IIS spawning an ASP.Net application will use 1 thread until request is done.</p> <p>Is the best option to write a stand-alone http-server? Doesn’t .Nets TcpListener leverage httpd.sys (IIS)?</p> <p>Any (constructive) thoughts on the subject would be appreciated.</p> <p><strong>Edit: Adding some useful links to this post found by following links from Nicolas Repiquets answer:</strong></p> <ul> <li><a href="http://msdn.microsoft.com/en-us/magazine/cc300760.aspx" rel="nofollow noreferrer">Get Closer to the Wire with High-Performance Sockets in .NET</a></li> <li><a href="https://stackoverflow.com/questions/319732/tips-techniques-for-high-performance-c-server-sockets">Tips / techniques for high-performance C# server sockets</a></li> <li><a href="http://www.codeproject.com/KB/IP/high-performance-server.aspx" rel="nofollow noreferrer">High Performance TCP/IP Server using C#.NET</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload