SignalR on AppHarbor with multiple instances
Asked Answered
C

2

7

I'm evaluating using SignalR in an app hosted at AppHarbor running on 2+ instances (web workers) but reading around it looks like thsi won't work: SignalR wiki says that scaling in a web farm is still in development (and 2+ web workers sounds like web farm to me). Another question here on StackOverflow says it won't work on more than one iss server. On the other side, on AppHarbor support site they say it works great without giving much info thought (didn't answer to all questions like # of simultaneous connection, limits of load balancers etc).

Can someone confirm if SignalR is the right path to take on AppHarbor?

Thanks!

Choleric answered 13/2, 2012 at 8:10 Comment(0)
A
9

David Fowler is working on a Redis message store for SignalR. The code is on Github and I believe it is what will let SignalR apps scale to multiple AppHarbor instances.

Applique answered 13/2, 2012 at 8:19 Comment(11)
That's correct. We're probably going to look at solutions using other technologies as well but here's an example of JabbR running on redis (using one node right now). This app should be able to scale across nodes. jabbr-redis.apphb.comAngel
I imagine that Redis is used to store messages, right? Where does SignalR normally store there? In local file system (that is obviously wiped by appharbor at each deploy)? A part for wipe at deploy wouldn't local file system works? Does each web worker have its own or there's just one file system for app?Choleric
SignalR normally stores things in memory. The current implementation uses redis as a pure message bus, not to store messages. Messages are replicated to each node when they come in. What needs to be added is some fault tolerance so that when a new node comes up or one that was down comes back up it repopulates its cache from redis or wherever we decide to buffer messages.Angel
@Choleric using local filesystem for storage wouldn't work, since each instance has its own filesystem which is not synced with other instances.Applique
@dfowler when you say "current implementation" what do you mean? "Original" SignalR or your SignalR.Redis? I wonder if "original" SignalR already replicates messages to each nodes when they come in?Choleric
SignalR by itself is in memory, one node. SignalR.Redis uses redis to push messages to all nodes.Angel
maybe for somebody (like me) who does not know Redis it should be noted that using Booksleeve and Redis you publish and subscribe to messages similar to a message bus.Karlenekarlens
@dfowler Do you really need to repopulate the cache when a node comes back up? A MessageBus node should only care about new messages, the "past" messages will be served from the repository and this is handled by the consumer application not by SignalR itself (i.e.: Jabbr Chat Hub GetPreviousMessages method)Scrofulous
It depends, I think it needs to be configurable so people can tweak durability but maybe I'm overthinking it.Angel
For the currently latest info regarding supporting web farms, have a look at dfowler's blog post about SignalR 0.5.Knar
Is SignalR.Redis no longer in the works? The github page is no longer around. =(Hygro
E
0

Updated links for 2014:

SignalR's Redis page on GitHub, which is currently just a URL to a Redis doc on ASP.Net website.

Eunuchize answered 28/7, 2014 at 3:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.