views:

15

answers:

1

I want to configure ASP.NET Website Project using WCF Service[NetTcp] (both in c#) for web-farm (for website) and NLB Load balancing (for service). I would like to configure following options for same.

NetTcpBinding.maxConcurrentCalls, NetTcpBinding.ListenBacklog and NetTcpBinding.MaxConnections

Note: During single machine configuration when I changed value of NetTcpBinding.ListenBacklog and NetTcpBinding.MaxConnections in WCF Service project to more that 10, which is default value. I got exception. When I changed this value in Website it was working fine. Due to this I had to keep in default configuration. Not sure why this is the case. If anyone could explain this it would be helpful.

Following reference gives idea how to configure in given environment but does not tell how to go about it.

Ref: http://msdn.microsoft.com/en-us/library/ee377061%28BTS.10%29.aspx

Update:

Let me simplify a bit. Lets say I have following configuration.

  • 2 IIS servers in Web Farm.
  • 3 WCF Service Servers (NetTcp) in NLB
  • Default config. for single instance.
    • NetTcpBinding.ListenBacklog: 10
    • NetTcpBinding.MaxConnections: 10
    • NetTcpBinding.maxConcurrentCalls: 16

Now what will be my configuration setting in this environment. Will it be same as above or will be as follows.

  • Suggested config. for single WebFarm/NLB
    • NetTcpBinding.ListenBacklog: 30 (10*3)
    • NetTcpBinding.MaxConnections: 30 (10*3)
    • NetTcpBinding.maxConcurrentCalls: 48 (16*3)
A: 

For load balancing net.tcp using Windows NLB you should have a shorter leaseTimeout with a value of 30 sec being suggested in MSDN. Make sure you use per call services. Configure NLB to balance individual port for each endpoint (if you have multiple endpoints) rather than port range as this increases performance. Make sure that affinity is unchecked.
I use a custom binding that has served me well as shown below

<customBinding>

        <binding name="netTcpBindingConfiguration_custom"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:01:00" >
          <transactionFlow/>
          <windowsStreamSecurity/>
          <binaryMessageEncoding/>

          <tcpTransport maxBufferPoolSize="524288"
                        maxReceivedMessageSize="5000000"
                        connectionBufferSize="8192"
                        manualAddressing="false"
                        hostNameComparisonMode="StrongWildcard"
                        channelInitializationTimeout="00:00:05"
                        maxBufferSize="5000000"
                        maxPendingConnections="20"
                        maxOutputDelay="00:00:00.2000000"
                        maxPendingAccepts="5"
                        transferMode="Buffered"
                        listenBacklog="20"
                        portSharingEnabled="false"
                        teredoEnabled="false">
            <connectionPoolSettings groupName="default"
                                    leaseTimeout="00:00:30"
                                    idleTimeout="00:02:00"
                                    maxOutboundConnectionsPerEndpoint="100"/>
          </tcpTransport>
        </binding>
</customBinding>
Pratik
Thanks will try these settings and let you know. Could you tell anything about exception I was getting when changing NetTcpBinding.ListenBacklog and NetTcpBinding.MaxConnections values in WCF setup.
BigBoss