我们有超过100个客户站点拨打电话的WCF服务。今天,我们开始收到WCF生产中的“太多主动安全协商”错误
Exception: Server 'http://[url]/services/[service].svc/ws' sent back a
fault indicating it is too busy to process the request. Please retry later. Please see the
inner exception for fault details.
System.ServiceModel.FaultException: There are too many active security negotiations or
secure conversations at the service. Please retry later.
我能找到的唯一信息是,我需要做的maxPendingSessions
较大。但是这需要将端点更改为CustomBinding,这很困难,因为我必须将其推送到所有客户端网站。
有没有什么办法可以“重置”安全协商的次数等?这会让我们有时间更改客户端程序以使用自定义绑定,因为目前,我们的网站无法与我们的服务器通话。
我试过对配置文件进行一些小改动并保存,这应该会重新启动服务,但我们仍然遇到错误。
或者还有其他方法可以处理这个问题吗?
编辑这里是我的配置:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data"/>
</configSections>
<connectionStrings>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Error" propagateActivity="true">
<listeners>
<add name="xml" />
</listeners>
</source>
</sources>
<sharedListeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="D:\logs\log.txt" />
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<diagnostics performanceCounters="All" />
<services>
<service name="WCFServiceLibrary.WCFService">
<endpoint address="ws" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IWCFService"
name="WSHttpEndpoint_IWCFService" contract="WCFServiceLibrary.IWCFService" />
<endpoint address="basic" binding="basicHttpBinding"
name="BasicHttpEndpoint_IWCFService" contract="WCFServiceLibrary.IWCFService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IWCFService"
maxBufferPoolSize="524288" maxReceivedMessageSize="1048576">
<readerQuotas maxDepth="32" maxStringContentLength="65536" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Message">
<message clientCredentialType="Certificate" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceCredentials>
<serviceCertificate findValue="CN=[url]" storeLocation="LocalMachine" storeName="TrustedPeople" />
<clientCertificate>
<authentication revocationMode="NoCheck" certificateValidationMode="PeerTrust" />
</clientCertificate>
</serviceCredentials>
<serviceThrottling maxConcurrentCalls ="1001" maxConcurrentSessions="1001" maxConcurrentInstances="1000" />
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
</configuration>
编辑
我们尝试过的iisreset
,甚至重新启动服务器,它仍然抛出了同样的错误。
听起来像你有一个单一的服务与某种会话约束。如果您在问题中提供有关服务合同设置和配置的信息,这将有所帮助。 – 2011-06-08 19:51:48
@Sixto是的。它在IIS中托管。我已经添加了我的配置。 – Marcus 2011-06-08 20:01:18
回收应用程序池将回答您的重置问题,但不能解决您的问题。 由于您使用的是证书,因此您的问题可能由您的应用以外的其他因素引起。您的CA设置如何? – 2011-06-08 20:04:43