SkyPunch
SkyPunch

Reputation: 324

Scalability of LongPolling in .Net :Grand Finale

I did my research on how to implement comet like chat on asp.net / MVC. what i found was it can be done by Long Polling..

about long polling , because it keeps the threads open so many concurrent connections will be made making its porformance poor (or flat zero), cuz IIS aint meant for many concurrent connections

Now the Tools For Business :Pokein, SignalR, SocketIO, Now.Js (Skipping paid tools, Free is pretty :) ) as far as i know all these use long polling ,then what do they actually du to improve performance in IIS (All these can be used with asp.net)..

I also found Facebook uses Erlang (Dunno how to use it) to make it happen & ofcourse $100 million worth of hardware(balancing 70 million user). and FB uses long polling not some comet server( as far as my research goes).

I want to implement scalable long polling on asp.net MVC 3 the two finalsit i found are Here and here

All i want to know which is better and why.. and also which tool is best among the given ones

Upvotes: 3

Views: 1563

Answers (2)

Muthu
Muthu

Reputation: 2685

Though your marked the answer, I am tempted to give this answer as I'd been through this and for long time as well.

I have used the solutions from two big COMET players. One is websync and the other is PokeIn. Web sync was good but expensive. I had lots of problems with PokeIn in terms of successfully using it. I actually did not use this for Chat server but for a push live update where some external program sends/pushes the updates to the subscribed clients.

I suggest you try using IHttpAsyncHandler based logic. This is again a long-polling sort of technique, but the client returns after sending the request and the server can send the response asynchronously.

Sorry for the self-publicity. I have a sample implementation of this in a project named flycomet in codeplex. This simply has a handler which receives requests and based on the type of request responds with the replies if any.

Currently the implementation is not given as a chat server but as a Windows Console Push Client Application and the subscribers can be from asp .net or MVC or silverlight. The advantage is you can tune the code to scale for yourself.

If you want to modify this as a chat application, it is quite easy to push the data through jQuery.

Upvotes: 1

Mike Gwilt
Mike Gwilt

Reputation: 2449

My opinion would be that SignalR would be the better choice, if not only because if you use SignalR.WebSockets, it will automatically upgrade the connection to web sockets if the user's browser supports it. This way, over time, as users begin to upgrade the browsers and away from the long-polling scheme, the scalability of your chat application will actually get better.

Moreover, there is an awesome code example called JabbR, created by the very people that created SignalR. (who also happen to be developers on the ASP .NET team)

http://jabbr.net/ - an example of SignalR in action.
https://github.com/davidfowl/JabbR - JabbR source.

Upvotes: 2

Related Questions