WCF and Concurrent usage throttling

Published Wednesday, June 27, 2007 12:37 PM

Have a requirement to interface with a legacy system that exposes a set of web services. The legacy system is not terribly fast and there are concerns by the client that it cannot handle excessive load. It seems to handle the current load ok, but we have been tasked with writing a system which will interface directly with the legacy system and potentially increase that load substantially. I can neither confirm nor deny the legacy systems ability to handle our projected load as the metrics simply are not available and its not feasible to generate them at this time.

So, the design decision is to implement our system such that it only allows a certain amount of requests through to the legacy system.

To do this, I have adopted a Unit of Work approach to the legacy system and will create a WCF service that acts as the system gateway (and no, it wont be strict Unit of Work pattern, but the concept is identical).

The service gateway will be exposed via a named pipe binding and it will use a serviceThrottling service behavior to limit the number of concurrent requests to the required number deemed "manageable" by the legacy system.

I like this approach because it means WCF can deal with the concurrency regulation, and I am sure it would do a better job than me at queuing and managing the requests. Its pretty simple, and also pretty fast. The named pipe binding is extremely high performing and the design of a service boundary now, means it will be trivial to expose this to other clients in the future using other bindings such as wsHttpBinding.

by Glav
Filed under: , , ,


# Jonathan Parker said on Tuesday, June 26, 2007 10:33 PM

So you're replacing the current asmx web services with named pipes? I'm sure it will fly as long as there's no internal bottlenecks! It would be great to see some metric on this in the future.

# Glav said on Tuesday, June 26, 2007 11:27 PM

Hi Jonaythan,

Well sort of. I am front ending the ASMX web service with a named pipes service that throttles requests down to a specified number of concurrent calls (the named pipe service is only within my systems boundary). Remember, I am trying control the number of requests from my application going to the legacy ASMX services which are under question in terms of their supporting system's ability to cope.

So in a way, I am actually introducing a configurable bottleneck to mitigate the risk of overloading the legacy system. The point is that it is controllable and I can tune my named pipes service depending on the ability and behavior of the legacy system.

# Jonathan Parker said on Thursday, June 28, 2007 10:10 PM

Cool. I never thought of throttling as a way to restrict the client calls. Looks like a nice simple solution though.

# Aaron Saikovski said on Thursday, July 12, 2007 10:25 PM

I would like to see what kind of performance you get out of this interface as i might need to use it myself soon.

# Yuan said on Monday, January 10, 2011 10:25 AM

Hope you could see this message.

I have a same problem. I was just wondering if you could give me example of your solution.

thanks in advance

# Abhijit Kharde said on Monday, May 7, 2012 6:47 AM

Nice workaround. This is what I can say a practical application of WCF :)

Leave a Comment


This Blog