0

I'm somewhat new to WCF and a call to get a record is taking almost 20 seconds, even a local call during debug takes that time. It completes correctly but is so slow.

Client call:

var docImgSvc = new DocImagingService.DocImagingStatusServiceClient("WSHttpBinding_IDocImagingStatusService");
CurrentManifest = docImgSvc.GetManifest(manifestLookup);  //<<---This takes 20 secs
if (CurrentManifest == null || CurrentManifest.ManifestId == 0)

Server routine:

public Manifest GetManifest(int manifestNumber)
{
    var de = new DocumentImagingEntities(); //<<---Takes 20 secs before it gets here.
    var manifest = de.Manifests.FirstOrDefault(m => m.ManifestId == manifestNumber);
    return manifest;
}

Server config:

  <system.serviceModel>
<services>
  <service name="DocImagingServices.DocImagingStatusService">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Design_Time_Addresses/DocImagingServices/DocImagingStatusService/"/>
      </baseAddresses>
    </host>
    <endpoint address="" binding="wsHttpBinding" contract="DocImagingServices.IDocImagingStatusService">
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

Client Config:

  <system.serviceModel>
<bindings>
  <wsHttpBinding>
    <binding name="WSHttpBinding_IDocImagingStatusService" closeTimeout="00:01:00"
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
      maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
      textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
      <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:8732/Design_Time_Addresses/DocImagingServices/DocImagingStatusService/"
  binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDocImagingStatusService"
  contract="DocImagingService.IDocImagingStatusService" name="WSHttpBinding_IDocImagingStatusService">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
</client>

strattonn
  • 1,790
  • 2
  • 22
  • 41
  • 2
    I wonder if this is similar? http://stackoverflow.com/questions/10859832/why-is-the-first-wcf-client-call-slow – lhan Oct 25 '12 at 19:00
  • @lhan16, in the question you link to the problem was that the first hit took 700 ms, here it takes 20 seconds – Shiraz Bhaiji Oct 25 '12 at 21:31

1 Answers1

0

Previously when I have seen that type of response time it has been due to the application pool settings.

There is a setting that allows you to load the user profile when running the application pool, this load time could match your 20 seconds.

See http://blogs.msdn.com/b/vijaysk/archive/2009/03/08/iis-7-tip-3-you-can-now-load-the-user-profile-of-the-application-pool-identity.aspx for a screen dump of how to set this value.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252