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

4

5

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";
    }
Tersanctus answered 24/1, 2014 at 8:37 Comment(0)
P
2

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

Progenitive answered 24/1, 2014 at 9:40 Comment(1)
opening two tabs never works however different instances of wcftestclient certainly worksTersanctus
H
4

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

Hemlock answered 24/1, 2014 at 11:27 Comment(0)
P
2

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

Progenitive answered 24/1, 2014 at 9:40 Comment(1)
opening two tabs never works however different instances of wcftestclient certainly worksTersanctus
E
1

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

Ebullient answered 24/1, 2014 at 8:47 Comment(0)
A
0

If you company has a copy of LoadRunner (hp product), you'll be able to build up enough fake transaction to actually test throttling.

In our case, we actually built a multi-instance, multi-threaded program to slam our web service with 1000+ concurrent (fake) users, each uploading 40 files. It was only then that we were able to see the throttling begin to take effect.

BTW, we tried a bunch of different combinations to see if we could tweek the settings and increase the performance, but in the end, the fastest we were able to get our web service running was under the default settings for throttling ... in other words, no throttling at all, just letting WCF manage the traffic and queue. Weird, huh?

Abstention answered 24/1, 2014 at 11:14 Comment(5)
By no throttling, do you mean default throttling?Watts
The default is that no throttling is applied. In other words, right out of the box, there's no throttling being used in WCF implementation.Abstention
But if you don't apply any throttling WCF has defaults.Watts
Perhaps ... I'm not sure what they are. They behavior we saw that that if you launched, say, 1000 concurrent requests, the web service would try to process about 150 and the rest would be queued by the web service. So maybe there's a default in there somewhere.Abstention
I linked to the defaults in my previous comment. There was also a threading bug in .NET 4 that affects WCF performance and is fixed in 4.5.Watts

© 2022 - 2024 — McMap. All rights reserved.