问题
I am hitting into a problem with my company application.
I am going to summarize the system key elements:
- My company's system is running since few years on Windows XP and 7 (Home, Pro, Basic) machines.
- It has been written in .NET 4.0 and based upon WCF.
- It uses the default throttling values (MaxConcurrentSessions = 100 * CPU (4) : enough for our workload).
- The main service is hosted by a stand alone deamon process (not IIS).
- The main service is configured as Multithraded/PerSession instances.
- The protocol is Reliable NET.TCP.
- No more than 10 clients access concurrently the service.
The problem is that only on Windows 7, intermittently, I get (I discovered that by the WCF full trace log) a "Server too busy exception" due to an exhausted MaxConcurrentSessions limit (impossible!!!).
Do you have any idea about this strange behaviour?
Thank you and have a Happy New Year!
Antonio
回答1:
Do all your Clients properly close/dispose connection to service after use ? It's worth to check, "ghost" connections could maybe explain this.
回答2:
We experienced a similar issue with a self-hosted WCF interface which provided a synchronous request/response web service for an asynchronous (2 one way service calls) backend request. Early in our testing, we noticed that after a somewhat variable amount of time, our service became unresponsive to new requests. After some research, we discovered that whenever the backend service (out of our control) did not send a response, we continued to wait indefinitely and as such we kept our client connection open.
We fixed the issue by providing a “time-to-wait” configuration value so we were sure to respond to the client and close the connection. We used something like the following …
Task processTask = Task.Factory.StartNew(() => Process(message));
bool isProcessSuccess = processTask.Wait(shared.ConfigReader.SyncWebServiceWaitTime);
if (!isProcessSuccess)
{
//handle error …
}
The following link, which provides information regarding WCF Service performance counters, may help further determine if the calls are being closed as expected. http://blogs.microsoft.co.il/blogs/idof/archive/2011/08/11/wcf-scaling-check-your-counters.aspx
Hope this helps.
Regards,
来源:https://stackoverflow.com/questions/20842923/wcf-maxconcurrentsessions-exceeded