I am creating a WCF server-client application. However, in my first test, a simple call (the method basically just return true;
) takes a lot of time (~5 seconds)
I tried to trace it, and here's a screenshot of the call trace
As you can see between line 2 and 3 ther's a lapse of 5 seconds (although to be honest I don't know what line 2 and 3 means)
At the client's (caller's) configuration, the binding is like this (mostly generated by Visual Studio
<wsHttpBinding>
<binding name="WSHttpBinding_IAgent" 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="None">
</security>
</binding>
</wsHttpBinding>
and at the server
<wsHttpBinding>
<binding name="WSHttpBinding_IAgent" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:05:00" sendTimeout="00:05:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="16777216" maxReceivedMessageSize="16777216"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="16777216"
maxArrayLength="16384" maxBytesPerRead="16384" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None"/>
</binding>
And the way I call it something like this
var client = new AgentClient(binding, BuildEndpointAddress(hostName, port));
for(int i =0; i<10; i++)
client.IsAlive(); //this call is very slow despite just returning true;
// subsequent calls are also slow so probably not because of wake-up time
Note for this test, both server and client are in the same computer so it couldn't be a network issue. Any idea what's causing the slowness or how I can find more information to troubleshoot this?