Kb2538826 explains the problem that occurs in the WCF Service in case of sudden requests: when your WCF Service receives sudden requests, the default value is.. net I/O completion port (iocp) thread pool may not be extended and your WCF response time will increase as soon as possible. This article WCF scales up slowly with bursts of work explains what happened.
The solution is to execute the WCF Service through another thread pool. Implementing this solution may produce a small amount of overhead. The performance test results for each WCF Service are different.
WCF listener |
Recommended Solution |
HTTP sync module (default in 3.x)-used in integrated application pool |
Switch to the async handler and then apply the solution in this article or alternatively use a private threadpool (see links following this table) |
HTTP aync module (default in 4.x)-used in integrated application pool |
Apply the code solution in this article |
ISAPI-used in Classic mode application pool |
Apply private threadpool (see links following this table) |
TCP. net |
Apply the code solution in this article |
Note: when using the WCF listener, this solution does not prevent incoming threads from waiting for the code of the WCF Service.
If you follow the table above and cannot apply the solution in this article, use an example of a dedicated thread pool in the msdn article:
Synchronization contexts in WCF Juval Lowy synchronize environment http://msdn.microsoft.com/zh-cn/magazine/cc163321.aspx in WCF
To use an asynchronous HTTP handler, follow these steps:
1. the WCF adjustment threshold should be high enough to handle expected bursts at an acceptable response time.
2. if you use. net CLR default thread pool, staff or iocp for your WCF Service, you must ensure a minimum number, the number of threads you expect to execute concurrently (the value begins to limit the number of threads created ).
3. Execute the following code to execute your WCF Service in your service. Net CLR working thread pool.
Reusing cookies in different WCF Web Services
Less tweaking of your WCF 4.0 apps for high throughput workloads