Does the js node work with asp net

Node.js vs .Net performance

TO BE FAST and with a lot HANDLING THE LOAD are two different things. A server that really does FAST one request per second, can totally croak if you send 500 requests per second (under ) DOWNLOAD ).

You also need to consider static (and cached) vs dynamic pages. If you're worried about static pages, IIS will likely knock the knot since IIS uses kernel mode caching, which means requests that make a static page request won't even come out of the kernel.

I suspect you are looking for a comparison between ASP.NET and Node. In this battle, after everything has been compiled / interpreted, you will likely be pretty close in performance. Maybe .NET is a bit MORE QUICKLY or the knot is a bit MORE QUICKLY but it's probably close enough that you don't care. I would bet on .NET, but I'm not sure.

The place where the knot is really convincing is for dealing with LOAD . This is where the technologies really differ. ASP.NET reserves a thread for each request from its thread pool, and once ASP.NET has exhausted all available thread requests, they are queued. If you are deploying "Hello World" applications like @shankar's example, it might not matter as it won't block the threads and you will be able to handle many requests before you run out of threads. The problem with the ASP.NET model occurs when you are sending I / O requests that block the thread (calling a database, sending an http request to a service, reading a file from disk). These blocking requests mean that your valuable thread from the thread pool is doing nothing. The more you block, the less LOAD can operate your ASP.NET app.

To prevent this blocking, use I / O completion ports that do not require a thread to stop while waiting for a response. ASP.NET supports this, but unfortunately not many of the common frameworks / libraries in .NET. For example, ADO.NET supports I / O completion ports, but the Entity Framework does not use them. So you can build an ASP.NET app that is purely asynchronous and that handles a lot of load, but most users don't because it's not as easy as building a synchronous app and you may not be able to do some Use your favorite parts of the framework (like Linq to Entities) when you do this.

The problem is that ASP.NET (and the .NET Framework) were built not to have an opinion on asynchronous I / O. .NET doesn't care whether you write synchronous or asynchronous code. So it's up to the developer to make that decision. Part of this is that threading and programming with asynchronous operations was seen as "difficult" and .NET wanted to make everyone happy (noobs and experts). It got even more difficult because .NET had 3-4 different patterns for asynchronous execution. .NET 4.5 tries to update the .NET framework again to have a discerning model for asynchronous I / O. However, it can take a while for the frameworks you want actually to support it.

The designers at Node decided against this, believing that ALL I / O should be asynchronous. This choice also allowed node designers to make a decision that each instance of a node is a single thread to minimize thread switching and that a thread only executes queued code. This could be a new request, it could be the callback from a DB request, it could be the callback from an http-rest request that you made. Node tries to maximize CPU efficiency by eliminating thread context switches. Since Node made this in the opinion of ALL I / O, this also means that all frameworks / add-ons support this selection. It's easier to write apps that are 100% asynchronous in Node (since Node forces you to write apps that are asynchronous).

Again, I don't have any hard numbers to prove one way or another, but I think Node would win the LOAD contest for the typical web app. A highly optimized (100% asynchronous) .NET app could give the corresponding node.js app a run for its money. However, if you've taken an average of all of the .NET and all of the Node apps out there, then on average the Node will likely handle more LOAD.

Hopefully this will help.