I have a WCF service with a NetTcpBinding running with about 100 clients. The clients regulary poll information from the server and after a while the service does not respond anymore.
Looking at netstat, I can see many connections that are in the CLOSE_WAIT state.
This is my binding:
<netTcpBinding>
<binding name="default" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxConnections="10000">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</netTcpBinding>
I have also tried to change the values of closeTimeout from the default of 00:01:00 to 00:00:10, but with no effect.
The machine is a Windows Server 2008 R2 64bit.
Update:
I have added a ServiceThrottlingBehavior
now, but the result is still the same.
new ServiceThrottlingBehavior
{
MaxConcurrentCalls = 1000,
MaxConcurrentInstances = 1000,
MaxConcurrentSessions = 1000
};
Update2
I have set the SessionMode to NotAllowed and changed the binding to streamed.
Any ideas what I could do to improve performance or to figure out the problem?
From your description, it seems: 1. initially the clients were able to connect to your server with no problem, so this rules out configuration problem 2. After a while server stopped responding, but you didn't say how long, and how big is the request rate, and whether the server stopped responding at all, or only intermittently responding. Based on this one possibility is that something is wrong on the server side. Did you noticed anything unusual on the server side? Things to look for is: