【发布时间】:2010-05-20 02:57:06
【问题描述】:
我的服务在低负载下运行良好。但在高负载下,我开始出现连接错误。
我知道其他设置,但我正在尝试更改 listenBacklog 参数,特别是针对我的 TCP 缓冲绑定。
如果我设置了listenBacklog="10",我可以远程登录到我的 WCF 服务正在运行的端口。
如果我将 listenBacklog 更改为高于 10 的任何值,它不会让我在运行时远程登录到我的服务。
似乎没有抛出任何错误。
我能做什么?
当我将 maxConnections 从 10 更改为远离时,我遇到了同样的问题。我可以将绑定的所有其他属性设置得更高而不会出现问题。
这是我的绑定的样子:
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_IMyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="524288"
maxBufferSize="1048576" maxConnections="10" maxReceivedMessageSize="1048576">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign">
</transport>
<message clientCredentialType="Windows" />
</security>
</binding>
...
我确实需要增加maxConnections和listenBacklog的值
【问题讨论】:
-
第一个问题很好。继续努力吧。 ...我看到您的 clientCredentialType 设置为 Windows。我不确定是否存在连接,但它让人思考:您是否也可能在托管您的应用程序的物理文件夹上设置了最多 10 个连接限制?检查一下。这可能是平台级问题,而不是逻辑 WCF 问题。
-
你在什么机器和操作系统上运行这个??我隐约记得某些 Windows 版本在 Windows 中内置了“最多 10 个客户端”限制 - 也许这就是你的问题:Windows 允许你有 10 个呼叫者,然后关上门......如果你在 XP 或其他东西上运行它:在 Windows Server 版本上试用