I have a signalR server app (Hub) that runs in Azure. Clients (HubConnection) connects to this server app. The memory consumptions for the server app (Hub) keeps increasing. My first idea was to reduce the number of messages in memory by setting this:
GlobalHost.Configuration.DefaultMessageBufferSize = 50; //Default is 1000
as explained in text
I'm using .NET 7 and
I can not find or don't know how to implement the DefaultMessageBufferSize in the program.cs file (the startup.cs file does not exist in the new .NET 6/7 project structure)? Does it not exist in newer signalR?
Any other suggestions on why the memory keeps increasing in the server app and what to do about it?
I would expect some options to clear memory in the signalR Hub.
More info: The OnDisconnectedAsync() gets called every minute in the class inheriting from Hub. We don't know why. Maybe by some old client. Can a lot of repeating disconnects course Hub app to increase in memory? And if Yes how the clear the memory/buffer for the specific disconnect on the Hub side?