gpt4 book ai didi

WCF + NetTcp : high load make the channel stop working (calls/second rate)

转载 作者:行者123 更新时间:2023-12-04 05:32:41 27 4
gpt4 key购买 nike

首先,抱歉,我不流利。

我想弄清楚为什么当我们的环境具有高调用/秒率时我的 WCF 服务停止工作。我不确定仅仅增加超时时间就能解决问题。

我们有 2 个网络服务:

  • 第一个托管在 IIS 7.5、Windows Server 2008 R2 Enterprise SP1 x64 和 AppFabric(和 WAS)上
  • 其次,托管在 Windows 服务,Windows 2003 R2 SP1 x86 上

两个网络服务都有最低配置:没有身份验证,没有交易,没有对消息进行特殊处理..检查绑定(bind):

<netTcpBinding>
<binding transactionFlow="false">
<security mode="None">
<message clientCredentialType="None" />
<transport clientCredentialType="None"></transport>
</security>
<reliableSession enabled="false"/>
</binding>
</netTcpBinding>

我们正在尝试使用 Net.Tcp 绑定(bind),因为它的可靠性和速度。

事实 1 - Net.Tcp 绑定(bind)是主要原因

当负载很高时, channel Net.Tcp 停止工作。而已!但是 BasicHttp 仍然很有魅力。

Windows 服务: channel net.tcp 在恢复工作之前持续了几分钟 (3m - 10m)(通过它自己,我们没有做任何改变。地精正在努力工作)。

AppFabric/IIS/WAS:net.tcp channel 保持关闭状态。需要手动重启。

BasicHttpBinding 配置类似于 net.tcp:没有对消息进行任何处理,没有安全问题或类似问题。

事实 2 - 没有任何类型的日志记录

我们找不到任何种类、提示和技巧来弄清楚发生了什么。我试过转储内存、事件日志、System.Diagnostics 和任何相关的东西。最相关的提示是来自 SMSvcHost 4.0.0.0 的错误:

An error occurred while dispatching a duplicated socket: this handle is now leaked in the process. ID: 2272 Source: System.ServiceModel.Activation.TcpWorkerProcess/62875109 Exception: System.TimeoutException: This request operation sent to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous did not receive a reply within the configured timeout (00:01:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.

Server stack trace: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.WorkerProcess.EndDispatchSession(IAsyncResult result) Process Name: SMSvcHost Process ID: 1532

您有什么提示或配置技巧可以帮助我解决这个问题吗?

高负载场景的最佳配置是什么?

最佳答案

如果您在 Visual Studio 中或使用 svcutil 工具生成服务引用,请确保您始终调用代理的 Close 或 Abort 方法。我前几天遇到了类似的问题,因为我忘了调用这些方法。

关于WCF + NetTcp : high load make the channel stop working (calls/second rate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12377901/

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