Appfabric cache maxconnectionstoserver

时间:2012-06-28 10:22:46

标签: asp.net appfabric connection throttling

我在使用AppFabric缓存时有关于网络连接限制的查询。

就基于ASP.NET WCF的应用程序而言,Windows AppFabricCache的“maxConnectionsToServer”设置如何与System.Net的“maxconnection”设置进行交互?

例如。如果,如下所示,maxConnectionsToServer设置为100但maxconnection设置为50,maxconnection是否会'overrriden'并变为100?或者maxconnection中的值是否限制maxConnectionsToServer的值?

...

<dataCacheClient requestTimeout="2000" channelOpenTimeout="0" maxConnectionsToServer="100">
  <hosts>
    <host name="127.0.0.1" cachePort="22233" />
  </hosts>
  <localCache isEnabled="true" sync="TimeoutBased" objectCount="10000" ttlValue="21600" />
</dataCacheClient>

...

<configuration> 
  <system.net> 
    <connectionManagement> 
      <add address="*" maxconnection="50"/> 
    </connectionManagement> 
  </system.net> 
</configuration>

...

提前致谢

1 个答案:

答案 0 :(得分:0)

system.net/connectionManagement对net.tcp连接没有影响,这是AppFabric正在使用的连接,只有ServicePoint基础架构管理的HTTP连接。因此,您不必担心这一点,只需为maxConnectionsToServer指定的内容。除非你看到争用,否则我可能不会将此设置为高于核心数。

为了将来参考,我还应该指出,如果您使用的是ASP.NET并且没有更改默认的processModel/@autoConfig属性,那么ASP.NET实际上将覆盖任何设置“*”maxconnections的尝试通过.config文件到12 * Environment.ProcessorCount。如果您无法在machine.config中更改processModel/@autoConfig或在IIS7.5中为应用程序池使用CLRConfigFile,那么您必须通过在应用程序启动期间设置ServicePointManager.DefaultEndpointConnectionLimit以编码方式重新覆盖此值(例如{{1 }})。