Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to test WCF throttling behaviour through Wcftest client?

Is it possible to test WCF throttling behaviour through Wcftest client?

If Yes then How?

I have a code below for ServiceHost

 ServiceThrottlingBehavior stb = _servicehost.Description.Behaviors.Find<ServiceThrottlingBehavior>();
        if (stb == null)
        {
            stb = new ServiceThrottlingBehavior();
            stb.MaxConcurrentCalls = 1;
            stb.MaxConcurrentInstances = 1;
            stb.MaxConcurrentSessions = 1;
            _servicehost.Description.Behaviors.Add(stb);
        }

My service has a method such as:

    public string ThrottlingCheck()
    {
        Thread.Sleep(new TimeSpan(0, 0, 0, 5, 0));//5 seconds
        return "Invoke Complete";
    }
like image 634
Devesh Avatar asked Jan 24 '14 08:01

Devesh


3 Answers

In the event that you are using “web” bindings, you could use the open-source soapUI/loadUI test tools.

SoapUI is a free and open source cross-platform Functional Testing solution. With an easy-to-use graphical interface, and enterprise-class features, SoapUI allows you to easily and rapidly create and execute automated functional, regression, compliance, and load tests.

Reference:
http://www.soapui.org/
http://www.soapui.org/Load-Testing/using-loadui-for-loadtesting.html

like image 152
Seymour Avatar answered Sep 24 '22 15:09

Seymour


As your request is taking 5 seconds, you can easily test this by invoking two operations at the same time by using two WCF Test Client or by opening two tabs in the same WCF client.

An integration test is certainly a better choice to check this behavior.

In addition, if your want to check that the behavior is really applied to your service, you could use WCF diagnostics such as WCF counters, especially "Percent of Max Concurrent XXX".

enter image description here

like image 23
Cybermaxs Avatar answered Sep 24 '22 15:09

Cybermaxs


No, it is not possible using WCF Test Client. If you have Visual Studio Ultimate you can use load tests/performance tests to test the throttling.

http://blogs.msdn.com/b/rickrain/archive/2009/06/26/wcf-instancing-concurrency-and-throttling-part-3.aspx?Redirected=true

like image 22
Wojciech Kmita Avatar answered Sep 25 '22 15:09

Wojciech Kmita