6

We have a WCF net.tcp service in high traffic site. http://www.artedelcorpo.com/

It works very well for some time, then it stops and returns a timeout error. When I restart IIS, it runs again.

Why? Is there a limit on connections?

Jonathan S.
  • 5,837
  • 8
  • 44
  • 63
user758977
  • 431
  • 1
  • 7
  • 19

2 Answers2

11

There is a default setting of 10 connections for the NetTcp Binding. You can increase this in the <binding> section of your config. The same is true of the timeouts - the default is 1 minute, but you can also adjust the close timeout, open timeout, receive timeout and send timeout.

<system.serviceModel>
    <bindings>
        <netTcpBinding>
            <binding name="MyNetTcpBinding" closeTimeout="00:05:00"
                     openTimeout="00:05:00" receiveTimeout="00:05:00"
                     sendTimeout="00:05:00" maxConnections="100" />
        <netTcpBinding>
    </bindings>
</system.serviceModel>

The above sample will set the timeouts to 5 minutes and the max connections to 100.

See <netTcpBinding> for more detail/information.

Yuck
  • 49,664
  • 13
  • 105
  • 135
Tim
  • 28,212
  • 8
  • 63
  • 76
  • Thanks for the answer. I set a 10 minutes timeout and 1000 connections. We have about 7000 unique visitor per day. – user758977 Sep 07 '11 at 14:02
5

Increasing network timeouts buys you time for the request to be processed. This can help you survive a short burst of high traffic, but it doesn't change your system throughput.

If your hardware still has some headroom in terms of memory and CPU when these problems occur, you should look at changing your concurrency throttles. This will allow more requests to be processed in parallel. The default throttle values in .NET 3.5 are actually quite conservative and this might be a quick fix (depending on your service architecture).

Here's some good examples of configuring WCF service throttles.

If your hardware is maxed out and you are still getting timeouts, its probably time to cluster the service and add another node.

Community
  • 1
  • 1
ErnieL
  • 5,773
  • 1
  • 23
  • 27