I'm trying to research an issue that another developer has reported. He claimed that when the Silverlight application we have created hits a WCF web service hard with concurrent calls that the calls start to be stacked at the server. His claim was that we are using sessions because of the method of authentication we are using (using forms and asp.net membership for sql). So I created a really simple test application
The application allows me to specify the number of concurrent calls to a web service I want and then indicates the current number of outstanding calls and the average response time in seconds.
The web service itself simple sleeps the thread for a second
public void DoWork()
{
Thread.Sleep(1000);
}
So what I thought would happen is that if my colleague was right, then the calls would be stacking up at the server so the average response would be 2 seconds if there are two concurrent calls. However what appears to happen is that the times remain at just above a second until I get to seven concurrent requests and then it starts to increase relatively predictably.
Running a second client (in a Chrome window along side the initial IE window) does not appear to impact the performance (there is an initial hiccup). This is not the case if you run two IE's or two Chrome's side by side, then the two seem to impact each other suggesting they are sharing a connection.
It also seems that fiddler was interfering. I ran the application without fiddler with 7 concurrent calls and it was averaging around 1.15 seconds per call. I then started fiddler and times dropped back to just over a second, it was as if fiddler was allowing the extra calls to get through.
So my question. What is going on here? Where is the throttling (at 6 concurrent requests) taking place (client or server)? Why does running fiddler speed up the requests?
Some extra info.
The web service class has a couple of attributes
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerSession)]
public class DoVeryLittle : IDoVeryLittle
{
public void DoWork()
{
}
}
AspNetCompatibilityRequirements is meant to allow integration with the asp.net pipeline and authentication. The ConcurrencyMode and InstanceContextMode of the ServiceBehavour are apparently to create and instance per session. However we are using the basicHttpBinding for the endpoint and I've seen that this does not support sessions so I'm a bit confused on this.
For completeness here are the service related entries in web.config
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="AspNetSqlRoleProvider" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>