我們有超過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