Using SignalR in an ARR cluster

My team ran into an issue when deploying an application which uses SignalR on a clustered environment using Application Request Routing (ARR). We created a simple three server setup with one server as an ARR node and 2 servers running the application. When accessing the site we saw some odd behavior.

1. All SignalR requests fail to use the more efficient transports (ServerSentEvents/ForeverFrame) and fall back to using Long Polling

2. Some messages get replayed multiple times in IE9

After looking into the issue for a while we figured out it was caused by a setting in ARR called Response Buffer Threshold.

Response buffer threshold (KB)

Lists the size of the buffer, in kilobytes, that ARR uses to retain a response before sending it to the client. Content that is smaller in size than the threshold can be cached.

By default this is set to 256kb which means that it will buffer responses until they reach that amount. By setting this to 0 ARR will no longer buffer and SignlR will function correctly.