Signalr Memory Issues RRS feed

  • Question

  • User-2023536938 posted

    Hi Guys

    We have developed a selfhost signalR web chat server running as a windows service.

    We have recently been doing performance testing and have picked up an issue with the memory.

    In our test scenario, we have 50 "agents" who can accept up to 2 chat sessions. (The incoming/outgoing "customer" messages go through a web service).

    So at any one point in time we have around a total of 150 connections (agent main connection plus 2 chat sessions each) and a connection that is created and disposed of each time a "customer" message is sent.
    Messages sent form the agent to the customer are done with a service call from the chat hub.
    In our performance test, about 800 messages are sent an hour. (about 182 a minute)

    The problem we are seeing, is when we run our performance test over a couple of hours, the memory usage of the service just keeps growing.

    We have monitored the memory using DOTMemory and observed the following.

    The objects that seem to be holding the most memory are:

    Microsoft.Aspnet.SignalR.Messaging.Topic -> MessageStore->Message[] ->Message -> System.Byte[]

    We do not send any massive messages with attachments or anything (yet), our max message lenght is 600 chars.

    Is there something we need to be doing to make sure the message-store is recycled correctly or is this a know bug in SignalR?

    Thanks in Advance.

    Friday, April 8, 2016 2:25 PM

All replies

  • User61956409 posted

    Hi BradSymons,

    I’d like to know the size of the message are sent between hub and clients. As far as I know, if large messages are being used, this may create memory issues. You could try to reduce message size and check if it will still create memory issue.


    Best Regards,

    Fei Han

    Monday, April 11, 2016 4:51 AM
  • User-2023536938 posted

    Hi Fei Han

    The messages are small, our maximum messages size is 600 characters, but most are much smaller than that.

    Monday, April 11, 2016 7:06 AM