WCF high instance count: anyone knows negative sideffects?

Ale*_*lex 5 .net c# performance wcf

Did anyone experience or know of negative side effects from having a high service instance count like 60k? Aside from the memory consumption of course.

我计划在生产环境中增加允许的最大实例数的阈值.我基本上厌倦了严重的生产事件只是因为"某些东西"忘记了正确关闭代理.

我计划进行类似60k实例的操作,这将允许服务使用默认会话超时以我们客户的平均呼叫率生存.

限制设置将是:

  • maxConcurrentCalls = 100
  • maxConcurrentSessions = 60000
  • maxConcurrentInstances = 60000
  • InstanceContextMode = PerSession

谢谢,亚历克斯

CkH*_*CkH 3

默认并发实例数为无限制。60k 没什么区别。

\n\n

当您没有对服务应用限制时,默认值是

\n\n
\xe2\x80\xa2maxConcurrentCalls = 16\n\xe2\x80\xa2maxConcurrentSessions = 10\n\xe2\x80\xa2maxConcurrentInstances = Unlimited\n
Run Code Online (Sandbox Code Playgroud)\n\n

有多种方法可以应用限制和扩展默认值,但所有这些都取决于您的 InstanceContext、并发和会话模式?根据这些答案,我可以建议最佳配置设置。

\n\n

我在关于 ESB through WCF / Trotdling Here 的文章中介绍了其中的一些内容

\n\n

更新:

\n\n

感谢您的答复。每个会话都可以。这里有一篇关于优化 WCFService 的好文章

\n\n

他们建议将您的设置更改为略高于 16 * CPU 数量。由于您是按会话使用,因此您应该将 ConcurrentCalls 设置为并发实例的 1-3%。

\n\n

假设您的服务器中有 8 个核心。我建议您在每个会话服务上设置一个起点,如下所示:

\n\n
<serviceThrottling maxConcurrentCalls="6"\n  maxConcurrentInstances="200"\n  maxConcurrentSessions="200"/>\n
Run Code Online (Sandbox Code Playgroud)\n\n

这应该可以消除客户端未关闭连接的问题,特别是如果您当前使用默认的 10 个会话。您的服务器应该能够处理更多的数据,但 60k 可能有点过大了。您可以根据需要进行测试和增加。这完全取决于盒子的功率以及你用它做什么。

\n\n

根据这些设置,如果您需要进一步增长,您可以监控性能并查看是否可以增加它们,否则,您可以轻松扩展到更多服务器和负载平衡。

\n\n

希望这有帮助...快乐编码

\n