【问题标题】:WCF service optimal configurationWCF服务优化配置
【发布时间】:2014-03-28 19:54:42
【问题描述】:

我正在为我的 wcf 服务使用 basicHttpBinding

<basicHttpBinding>
    <binding name="BasicHttpBinding_UtilityService" 
          closeTimeout="01:00:00" openTimeout="01:00:00" 
          receiveTimeout="01:00:00" sendTimeout="01:00:00" 
          allowCookies="false" bypassProxyOnLocal="false" 
          hostNameComparisonMode="StrongWildcard" 
          maxBufferSize="52428800" maxBufferPoolSize="52428800" 
          maxReceivedMessageSize="52428800" 
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
          useDefaultWebProxy="true">
      <readerQuotas 
             maxDepth="52428800" maxStringContentLength="52428800" 
             maxArrayLength="52428800" maxBytesPerRead="52428800" 
             maxNameTableCharCount="52428800"/>
      <security mode="None">
        <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="UserName" algorithmSuite="Default"/>
      </security>
    </binding>
</basicHttpBinding>

<behavior name="httpMetadataBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
      <dataContractSerializer maxItemsInObjectGraph="52428800" />
      <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="200" maxConcurrentInstances="200" />
</behavior>

请告诉我应该为maxArrayLengthmaxItemsInObjectGraph、打开/关闭和接收超时设置什么值。如果我将其设置为最大允许值,这样做有什么害处吗?

应该如何以最佳方式定义大小和超时值?

【问题讨论】:

    标签: wcf binding configuration


    【解决方案1】:

    最佳始终很大程度上取决于您正在做什么以及您的要求是什么。

    没有一个最佳设置——如果存在的话,您认为 WCF 团队不会将其设为默认设置吗?

    还有:

    YES 将所有内容设置为最大允许大小为潜在的拒绝服务攻击打开大门 - 这就是 NOT 设置为 2 的原因首先是每个大小值的 GB!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 2013-06-10
      • 2011-10-04
      • 2017-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多