如何从服务配置中提高性能?

时间:2013-03-02 14:53:35

标签: performance wcf silverlight web-config

我遇到的情况是,我有很多服务会在一个大型的Silverlight应用程序中经常被调用。经过一些非常轻微的测试后,我们发现事情正在放慢速度。我怀疑它来自服务,因为它来自很多电话的大量数据。

我想减少通话次数,但缺乏从头开始完全重新设计,目前只能部分实现。

我的所有服务都设置为在其服务行为中使用PerCall,这是我的配置

                <services>
        <service name="MyServices.Service">
            <endpoint address="" binding="basicHttpBinding" bindingConfiguration="LargeBuffer" contract="MyServices.Interface.Service" />
        </service>
    </services>
    <bindings>
        <basicHttpBinding>
            <binding 
      name="LargeBuffer" 
      closeTimeout="00:10:00" 
      openTimeout="00:10:00" 
      receiveTimeout="00:10:00" 
      sendTimeout="00:10:00" 
      maxBufferSize="2147483647" 
      maxReceivedMessageSize="2147483647"
      >
      <security mode="None">
        <transport clientCredentialType="None" />
      </security>
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
            </binding>
        </basicHttpBinding>
    </bindings>

这些服务很多都不需要大的缓冲区绑定,这会影响我的性能吗?

修改

调用本身正在高效运行,但只要我们收到几百个请求,就会出现问题

1 个答案:

答案 0 :(得分:1)

在性能非常重要的情况下,我发现FastInfoset编码很有用。 noemax有一个非常好的商业实现(虽然免费试用,但不是免费的)。

http://www.noemax.com/products/wcfx/index.html

它还可以让您非常有效地进行良好的压缩。

免责声明 - 我只在Windows上使用它,而不是Silverlight。它声称支持silverlight。