【发布时间】:2011-11-19 02:27:40
【问题描述】:
我的公司拥有一台具有 24 个内核和大量内存的服务器。操作系统是 Windows 2008 R2 SP1。我在这台服务器上部署了一个 WCF 应用程序,托管在 IIS 中。在同一台服务器上,我安装了一个多线程客户端,它尽可能频繁地调用 WCF 服务之一。我遇到了一个瓶颈:服务器上的所有核心都被使用了,但是处于非常低的水平,因此 CPU 消耗不超过 10%。我的 WCF 服务配置如下:
<system.serviceModel>
<services>
<service behaviorConfiguration="myBehavior" name="...">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="myBinding" bindingNamespace="..." contract="..."/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="myBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="myBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" portSharingEnabled="false" transactionFlow="false" listenBacklog="2147483647">
<security mode="None">
<message clientCredentialType="None"/>
<transport protectionLevel="None" clientCredentialType="None"/>
</security>
<reliableSession enabled="false"/>
<readerQuotas maxDepth="64" maxStringContentLength="204800" maxArrayLength="204800" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
</binding>
</netTcpBinding>
</bindings>
我的服务还具有以下属性:InstanceContextMode.Single 和 ConcurrencyMode.Multiple。有没有人遇到过类似的问题?我搜索了几天的解决方案,但我还没有找到它:(
提前谢谢你!
【问题讨论】:
-
是什么让你认为 CPU 使用率是制约因素?
-
在“只有”八核的服务器上,我获得的性能几乎与我在帖子中提到的服务器上相同...
-
@schglurps 如果你在 8 和 24 上获得相同的性能,这几乎证明它与 CPU 无关
标签: c# wcf performance iis-7.5