locked
Load Test SignalR Application RRS feed

  • Question

  • User1950336107 posted

    Hi All ,

    I have written my application using signalR library and it is working fine for low number of connections. I want to load test my application.

    I have written separate load test application using signalR.Client  using below code

    for (int i = 0; i < MAX_CONNECTION; i++)
                {
                    try
                    {
                        var hubConnection = new HubConnection("http://xyz.com/mySignalRApp/signalr");
                        IHubProxy chatHub = hubConnection.CreateHubProxy("chatHub");
                        hubConnection.Start(new WebSocketTransport()).Wait();
                        

                        chatHub.Invoke("myHubMethod", "methodParameters").ContinueWith(task2 =>
                        {
                            if (task2.IsFaulted)
                            {
                                Console.WriteLine(String.Format("An error occurred during the method call {0}", task2.Exception.GetBaseException()));
                            }
                            else
                            {
                                Console.WriteLine("Connection Number : " + (i + 1) );
                                //                            successfulConnections++;
                            }
                        });

                    }

    This code works fine for upto ~1000 connections, after that it is either throws "timedout error" or "port exhaust" error.

    I know Crank is there but I did'nt find a way in Crank on how to call perticular Hub Method with parameters and thats why I am not using it to test my application.

    I deployed the application on high configuration machine to get the maximum number of concurrent connections my server/application can support.

    Note that - In my application when client subscribes to server there is high data flow from server to client.

    Tuesday, March 10, 2015 5:18 PM

All replies

  • User61956409 posted

    Hi SantyM,

    Thanks for your post.

    Firstly, you could refer to this similar issue.

    Besides, you could refer to this link to improve performance in a SignalR application.

    Best Regards,

    Fei Han

    Tuesday, March 10, 2015 10:53 PM
  • User1950336107 posted

    Fei, Thanks for your reply. I already done with the changes suggested in above posts.

    In my situation when there is no data flow from server to client , I get more than 50,000 connections. But as soon high volume data starts ,the number of connections get reduces. As server starts dumping data at client side. I don't understand is it the client who is not able to handle that much of data push or the server when he is busy not able to take further connections. Also I observed that the performance counter  "Number of Disconnected Client" increases as number of client increases.

    Wednesday, March 11, 2015 12:09 AM
  • User1950336107 posted

    Awaiting reply from expertise.

    Friday, March 13, 2015 2:41 PM