生产中WCF"太多活动安全协商"错误

Mar*_*cus 6 wcf config exception

我们有一个WCF服务,超过100个客户端站点拨打电话.今天我们开始了

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.
Run Code Online (Sandbox Code Playgroud)

我能找到的唯一信息是我需要制作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>
Run Code Online (Sandbox Code Playgroud)

编辑
我们尝试了iisreset甚至重新启动服务器,它仍然抛出相同的错误.

Ali*_*tad 3

http://social.msdn.microsoft.com/Forums/en-GB/wcf/thread/a8f82f1d-e824-474e-84ef-b5e9ba7eca18

问题是创建客户端但不使用它(不调用它的任何方法)。

http://litemedia.info/there-are-too-many-active-security-negotiations-or-secure-conversations-at-the-service

我花了 4 天在 .NET 4.0 中调查这个问题,发现它还没有修复。

重现很简单:

ChannelFactory<IFoo> foo = new ChannelFactory<IFoo>("binding");
foo.Open();
foo.Close();
Run Code Online (Sandbox Code Playgroud)

调用 128 后,您会收到错误消息。

我不知道为什么它没有修复,但解决方案是当您确定需要调用它时创建代理。增加 maxPending noy 确实有用,因为您可能仍会达到阈值。