Click here to Skip to main content
15,896,915 members
Articles / General Programming / Performance

Tweaking WCF to build highly scalable async REST API

Rate me:
Please Sign up or sign in to vote.
4.92/5 (35 votes)
31 Jul 2011CPOL25 min read 118.9K   1.2K   85  
You can build async REST API using WCF but due to some bug in WCF implementation it does not scale as you would want it to. Here's my journey with Microsoft's WCF team to explore the problem and find the right fix.

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfAsyncRestApi", "WcfAsyncRestApi\WcfAsyncRestApi.csproj", "{177CE122-6B26-4B33-8013-610AA58C84F4}"
EndProject
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "SomeSite", "SomeSite\", "{348BA2F2-EF3B-4DBF-A8DD-6DC748D85939}"
	ProjectSection(WebsiteProperties) = preProject
		TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
		Debug.AspNetCompiler.VirtualPath = "/SomeSite"
		Debug.AspNetCompiler.PhysicalPath = "SomeSite\"
		Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\SomeSite\"
		Debug.AspNetCompiler.Updateable = "true"
		Debug.AspNetCompiler.ForceOverwrite = "true"
		Debug.AspNetCompiler.FixedNames = "false"
		Debug.AspNetCompiler.Debug = "True"
		Release.AspNetCompiler.VirtualPath = "/SomeSite"
		Release.AspNetCompiler.PhysicalPath = "SomeSite\"
		Release.AspNetCompiler.TargetPath = "PrecompiledWeb\SomeSite\"
		Release.AspNetCompiler.Updateable = "true"
		Release.AspNetCompiler.ForceOverwrite = "true"
		Release.AspNetCompiler.FixedNames = "false"
		Release.AspNetCompiler.Debug = "False"
		VWDPort = "8080"
		VWDDynamicPort = "false"
		VWDVirtualPath = "/"
		DefaultWebSiteLanguage = "Visual C#"
	EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProxyStuff", "ProxyStuff\ProxyStuff.csproj", "{A2BF3C61-5FE1-4E1C-A853-77770890BA82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoadTestProxy", "LoadTestProxy\LoadTestProxy.csproj", "{3E82ACB9-0982-4D8F-A295-3C67641E4331}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncServiceLibrary", "AsyncServiceLibrary\AsyncServiceLibrary.csproj", "{F6D961EF-16E9-4CCE-ACD6-E34417BAE865}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{177CE122-6B26-4B33-8013-610AA58C84F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{177CE122-6B26-4B33-8013-610AA58C84F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{177CE122-6B26-4B33-8013-610AA58C84F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{177CE122-6B26-4B33-8013-610AA58C84F4}.Release|Any CPU.Build.0 = Release|Any CPU
		{348BA2F2-EF3B-4DBF-A8DD-6DC748D85939}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{348BA2F2-EF3B-4DBF-A8DD-6DC748D85939}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{348BA2F2-EF3B-4DBF-A8DD-6DC748D85939}.Release|Any CPU.ActiveCfg = Debug|Any CPU
		{348BA2F2-EF3B-4DBF-A8DD-6DC748D85939}.Release|Any CPU.Build.0 = Debug|Any CPU
		{A2BF3C61-5FE1-4E1C-A853-77770890BA82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{A2BF3C61-5FE1-4E1C-A853-77770890BA82}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{A2BF3C61-5FE1-4E1C-A853-77770890BA82}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{A2BF3C61-5FE1-4E1C-A853-77770890BA82}.Release|Any CPU.Build.0 = Release|Any CPU
		{3E82ACB9-0982-4D8F-A295-3C67641E4331}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{3E82ACB9-0982-4D8F-A295-3C67641E4331}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{3E82ACB9-0982-4D8F-A295-3C67641E4331}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{3E82ACB9-0982-4D8F-A295-3C67641E4331}.Release|Any CPU.Build.0 = Release|Any CPU
		{F6D961EF-16E9-4CCE-ACD6-E34417BAE865}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{F6D961EF-16E9-4CCE-ACD6-E34417BAE865}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{F6D961EF-16E9-4CCE-ACD6-E34417BAE865}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{F6D961EF-16E9-4CCE-ACD6-E34417BAE865}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions