50

What kind of sockets does Stack Overflow use for the realtime reputation updates? Is it something like Netty-Jetty or SignalR? Are they using web sockets implemented in C#?

0

1 Answer 1

91

UPDATE: StackExchange.Netgain is now open source!!
https://github.com/StackExchange/NetGain

We use a custom socket server that we developed in house. It supports every historic + RFC version of the web-sockets api; not just Hixie 76; hixie-76 === hybi-00; hybi-4/5/6/7/8, and hybi-13 === RFC6455. We treat sockets as a value add for those who use modern browsers and don't rely on it to provide all updates to our sites as websockets aren't supported in all browsers at this point.

We developed our own very simple protocol on top of websockets to provide rudimentary updates to question lists and as well as other interactions. We use redis messaging to support a unified messaging bus between all of our socket servers. The server side is a Windows service written in C# and the client side is jQuery.

There was talk of open sourcing our implementation but haven't reached a release yet. I have been very impressed with the load we've been able to handle thus far.

Here's a snapshot of haproxy at the moment:

socket traffic

In case you're wondering - that is 128k simultaneously connected web socket clients all receiving updates via our unified messaging bus.

Note by Marc Gravell♦: if people would be genuinely interested in our releasing this as open source, please let us know. It will take some effort. but isn't impossible.

11
  • 6
    We use redis messaging to support a unified messaging bus between all of our socket servers --- where can you find more information on that particular aspect?
    – wal
    Commented Feb 20, 2013 at 1:06
  • @wal you mean this? Commented Feb 20, 2013 at 8:22
  • 1
    @ShaWizDowArd we don't actually use service-stack for that; we have a separate library (BookSleeve) that we open-sourced ages ago - the key point in that library is that it is multiplexed, fully async-IO, and async Task oriented Commented Feb 20, 2013 at 17:15
  • @MarcGravell, We want this superb thing as Open Source :) Commented Feb 26, 2013 at 12:14
  • 1
    @MarcGravell genuinely interested, but I would be even more interested in hearing details on it: how you designed it, why redis, which choices you made, how does it work... Commented Mar 1, 2013 at 14:49
  • 6
    Still really interested in the open source idea, any updates? Commented Apr 30, 2015 at 14:50
  • @MarkGravell definitely still interested in hearing more about this! seems like every big site is forgoing websockets in favor or event-based subs (eg facebook's graphQL), so getting this info in the public domain could really help folks learn how to scale them well
    – Matt K
    Commented Jan 2, 2016 at 1:13
  • @MarcGravell will you guys open source it? Commented Jan 20, 2016 at 14:13
  • 3
    We just open sourced our socket server library: github.com/StackExchange/NetGain Commented Jan 26, 2016 at 17:55
  • We need best socket library for .net developer to go more with socket and SignalR comes in picture. But more of SignalR performance issue and not updating overtime i think best example of large Socket used in .net web application is Stack Exchange. Can community provide better Documentation to use this library?? Commented Feb 22, 2016 at 3:08
  • I am large fan of how you have implement sockets and what you have used in back end. And yes an micro ORM Dapper.net that i found more powerful and better performance then all other ORM (Entity Framwork) Commented Feb 22, 2016 at 3:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .