This exception often occurs when a large number of clients send requests to WCF services during WCF application development. WCF Service response timeout. The operation was not opened within the specified time 00:01:00, and the time allotted for this operation may be only part of the timeout period.
The error message is as follows:
The open operation did not complete within the allotted timeout of 00:01:00. The time allotted to this operation may have been a portion of a longer timeout.
"1" Error screenshot:
"2" Reason analysis:
This timeout exception arises directly because a large number of client requests are sent to the service. I use 100 clients here and instantiate 100 agents. Then request. Simulate a large number of concurrent requests from the client. Service basic delay 100MS. Analog processing. This is about 10 requests, and the service processing is blocked. And then wait, and finally the timeout exception occurs.
"3" Solution:
When it comes to a large number of requests, consider using WCF's Servicethrottlingbehavior property.
|
name | TD style= "BORDER:0;PADDING:0;" > description
maxconcurrentcalls |
|
maxconcurrentinstances |
|
maxconcurrentsessions |
|
Here we set the service limit flow behavior on it. as follows:
Servicebehaviors>
<behavior name= "Wcfservice.wcfservicebehavior" >
<servicetimeouts transactiontimeout= "00:01:00"/>
<servicemetadata httpgetenabled= "true"/>
<servicedebug includeexceptiondetailinfaults= "false"/>
<servicethrottling maxconcurrentcalls= "1000" maxconcurrentinstances= "1000" maxconcurrentsessions= "1000"/>-- >
</behavior>
</serviceBehaviors>
Here 1000 can be modified according to your actual WCF service demand. Service activation type and instance invocation method. And then make adjustments. After the modification, restart the service, basically normal.
Source: http://www.cnblogs.com/frank_xl/archive/2009/07/22/1528911.html