locked
High frequency(~20fps) data transfer with large messages(~1MB) using SignalR RRS feed

  • Question

  • User-1802510858 posted

    Hi,

    We are implementing a service which transfers data of range 256KB-1048KB(1MB) to connected client. Service should be able to send in a rate of 20 messages per second. We don't have broadcast scenario where we are sending the same data to multiple clients.

    SignalR documentation says 'High frequency' load pattern supports fixed high rate with unique messages(max 25 Hz).
    I checked above mentioned scenario with load test harness provided along with SignalR. (https://github.com/SignalR/SignalR/tree/dev/samples/Microsoft.AspNet.SignalR.LoadTestHarness)

    I modified the harness to send data of range 256KB - 1MB. One observation is as internally messages are stored in ring buffer of default size 1000.  I got high memory usage when started sending 1MB data in 20 FPS. I had to make DefaultBufferSize to 32 otherwise server stops responding after sometime because of high memory usage.

    My question is:
    Whether SignalR is a right choice where we have data of size 256KB - 1024KB and maximum send rate 20 messages per second?

    Thanks

    Basanth

    Thursday, December 15, 2016 3:22 AM

All replies

  • User283571144 posted

    Hi msbasanth,

    Whether SignalR is a right choice where we have data of size 256KB - 1024KB and maximum send rate 20 messages per second?

    As far as I know, There's no maximum message size but we recommend < 32K per message since they are being stored in a ring buffer (default size 5000).

    Storing larger messages will be awful for performance.

    Best Regards,

    Brando

    Friday, December 16, 2016 6:24 AM
  • User-1802510858 posted

    Thanks Brando,

    Is this message size recommendation(<32 KB) given for avoiding huge memory use in server?

    In our case we don't need to cache messages in server side and not require to support long polling (as  we always have server and client support WebSocket). So we can safely set the default message buffer size to 32(which is the minimum we can set). Concurrent clients we need to support is also less, maximum 100. So maximum memory usage for 100 persistent connections will go approx. 3.2GB.

     Any other reason for recommending less message size in SignalR?

     Regards

     Basanth

    Tuesday, December 20, 2016 8:01 AM
  • User1324658857 posted

    Hi,

    As far as I know, signalR use url to send the message, so if the message is too large, it will be slow.

    Besides, I don't suggest you use signlar to send big message, you could use another solution.

    Store the data in database, then send the id or list of id by signlar.

    Monday, December 26, 2016 2:34 PM