问题
I have a WCF hosted on IIS7. When I try to consume a service that takes more than 90 seconds to produce results, it times out after 90 second.
- In web config, I have increased my executionTimeout to 900 seconds
<system.web>
<compilation debug="false" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" executionTimeout="900" shutdownTimeout="900" maxRequestLength="2097152" enable="true"/>
<pages>
<namespaces>
<add namespace="System.Runtime.Serialization"/>
<add namespace="System.ServiceModel"/>
<add namespace="System.ServiceModel.Web"/>
</namespaces>
</pages>
<customErrors mode="Off"/>
<trace enabled ="true" pageOutput ="true" requestLimit ="20" traceMode="SortByTime" />
</system.web>
On the IIS side, I have set scriptTimeout to 00:05:10. (Default Website->ASP->Limits Properties->scriptTimeout)
In Application Pools, Advanced Settings, I have set Ping Maximum Response Time to 300 seconds (as well as Shutdown Time Limit. Though I don't think this helps.)
Even though I have increased every timeout variable I could find to over 90 second, my service still times out at 90 seconds.
Anyone know a timeout I might have missed?
回答1:
I took this from my config on my TEST server... this works. You're definitely going to want to change these values.
<binding name="tcp_unsecured_HighLimit" closeTimeout="23:59:59" openTimeout="23:59:59" receiveTimeout="23:59:59" sendTimeout="23:59:59" >
<readerQuotas maxDepth="104857600" maxStringContentLength="2000000000" maxArrayLength="2000000000"
maxBytesPerRead="2000000000" maxNameTableCharCount="2000000000" />
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
来源:https://stackoverflow.com/questions/16531045/increasing-timeout-for-wcf-hosted-on-iis7