Improving Hosted HTTP Request Scaling
A few months ago Wenlong Dong announced an improvement to HTTP request scalability when WCF is hosted in IIS. In order to take advantage of the improvement you need the combination of IIS7 or later and Orcas SP1 installed. Since this isn't the ubiquitous configuration yet, you need to follow the instructions that Wenlong provides in order to enable the improvement for your deployment.
The improvement works by replacing the existing synchronous WCF HttpModule and HttpHandler that is installed into IIS with an asynchronous version of the module and handler. The asynchronous module and handler allow IIS to pass many more concurrent requests to WCF at once than was previously possible. The synchronous module and handler would fill up with work much sooner due to the exhaustion of available threads. Although IIS has a backup queuing system for requests, it was not designed to run at these limits and so the system slows down and stops scaling as well after a certain point. The difference in scalability can be substantial when the number of concurrent requests is in the thousands.
The reason that the original WCF module and handler used the synchronous approach is that in past versions of IIS there was no other pushback besides synchronous blocking of the request handoff to prevent IIS from working itself to death. This is why you'll see strong cautions not to use the module and handler with earlier versions of IIS. There's no technical limitation preventing you from building a scalable solution on earlier versions of IIS but you would have to build request throttling to prevent your server from spinning up more work than it can handle. IIS7 added a new request throttling feature that provides this pushback, which is why the scalable approach works well there.
Comments
- Anonymous
March 02, 2009
Pick of the week: Paying Down Your Technical Debt General Leveraging ILMerge to Simplify Deployment and Your Users’ Experience : Daniel Cazzulino demonstrates how you can easily combine multiple assemblies into a single assembly. DDD Step By Step : Casey