Last post May 26, 2017 06:17 AM by EvenMa
May 25, 2017 08:46 AM|kiranthekkan|LINK
I have an asp.net application which uses signalR. This is working fine in my local developer machine. But when i tried to host this in Server, The application is not working fine. We have found that since we use multiple server to host applications request
from one server is not reflecting in the other. but when the requests are made in the same server the application runs. Can anyone give a possible solution to how to host signalR in multiple server environment(WebFarm)
May 25, 2017 11:08 AM|mgebhard|LINK
You can think of SignalR as a direct pipeline between the client browser and a single web server. In the case of web farm, as you experienced, you'll end up many user pipelines connected across multiple servers where each server has a different set of users.
If the application is designed to persist data on the web server directly then, rightfully so, the data is only available on that specific server. The other server cannot see the data unless some mechanism is in place to allow data sharing. Consider persisting
the shared data in a central location like a Database or look into using a
We have found that since we use multiple server to host applications request from one server is not reflecting in the other.
I'm assuming that you are storing data on the web server. If that is not the case, then please explain your setup.
May 26, 2017 06:17 AM|EvenMa|LINK
According to your description ,you could use SignalR backplane to resolve your issue.
Each server instance connects to the backplane through the bus.
When a message is sent, it goes to the backplane, and the backplane sends it to every server. When a server gets a message from the backplane, it puts the message in its local cache. The server then delivers messages to clients from its local cache.
For each client connection, the client’s progress in reading the message stream is tracked using a cursor (the cursor represents a position in the message stream). If a client disconnects and then reconnects, it asks the bus for any messages that arrived
after the client’s cursor value.
The same thing happens when a connection uses long polling. After a long poll request completes, the client opens a new connection and asks for messages that arrived after the cursor.
You could use SQL Server as backplane.
For more details about how to use backplane ,you could refer to the following link.
If you have any other questions, please feel free to contact me any time.