gpt4 book ai didi

生产中的 WCF "Too many active security negotiations"错误

转载 作者:行者123 更新时间:2023-12-04 14:35:58 27 4
gpt4 key购买 nike

我们有超过 100 个客户端站点调用的 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,这很困难,因为我必须将其推送到我的所有客户端站点。

有什么方法可以让我“重置”安全谈判的数量等等?这将使我们有时间更改客户端程序以使用自定义绑定(bind),因为目前,我们的站点无法与我们的服务器通信。
我尝试对配置文件进行小幅更改并保存,这应该会重新启动服务,但我们仍然遇到错误。

还是有其他方法可以解决这个问题?

编辑 这是我的配置:
<?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甚至重新启动服务器,它仍然抛出相同的错误。

最佳答案

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();

128 次通话后,您会收到错误消息。

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

关于生产中的 WCF "Too many active security negotiations"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6284210/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com