在wcf服务应用程序之后,asp.net应用程序工作得很慢

时间:2013-09-24 13:52:14

标签: c# asp.net performance wcf wcf-data-services

我正在开发一个asp.net应用程序,我正在使用一个WCF服务应用程序从此应用程序中的数据库获取数据。客户端应用程序的webconfig配置是这样的。

    <system.serviceModel>
   <bindings>
     <wsHttpBinding>
       <binding name="WSHttpBinding_IServicePaymentControllerUIClient"
        closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00"
        sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false"
        hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647"
        maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8"
        useDefaultWebProxy="true" allowCookies="false">
         <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647"
          maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
         <reliableSession ordered="true" inactivityTimeout="00:10:00"
          enabled="false" />
         <security mode="Message">
           <transport clientCredentialType="Windows" proxyCredentialType="None"
            realm="" />
           <message clientCredentialType="Windows" negotiateServiceCredential="true"
            algorithmSuite="Default" />
         </security>
       </binding>
     </wsHttpBinding>
   </bindings>
  <client>
   <endpoint address="http://localhost:63796/ServicePaymentControllerUIClient.svc"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServicePaymentControllerUIClient"
    contract="ServiceReferencePaymentControllerUI.IServicePaymentControllerUIClient"
    name="WSHttpBinding_IServicePaymentControllerUIClient">
    <identity>
     <dns value="localhost" />
    </identity>
   </endpoint>
  </client>
 </system.serviceModel>

在使用WCF服务之前我的asp.net应用程序非常快,但现在它的加载非常慢。 所以我想知道背后的原因,我怎么能摆脱这个问题? 如何提高我的应用程序的性能?

1 个答案:

答案 0 :(得分:1)

我找不到您的配置文件。 正如您所说,您的请求超时,您应该追踪错误是什么。

我建议您启用WCF跟踪以获取详细信息,配置跟踪源以发出跟踪并设置跟踪级别,设置活动跟踪和传播以支持端到端跟踪关联,并设置跟踪侦听器以访问跟踪。

http://msdn.microsoft.com/en-us/library/ms733025.aspx

http://msdn.microsoft.com/en-us/library/ms751526.aspx

谢谢你, Vishal Patel