ConnectTimeout setting

When a cluster member exists on a machine that is removed from the network (because its network cable is unplugged or it has been powered off, for example), the plug-in, by default, cannot determine the cluster member's status until the operating system TCP/IP timeout expires. Only then will the plug-in be able to forward the request to another available cluster member.

It is not possible to change the operating system timeout value without side effects. For instance, it might make sense to change this value to a low setting so that the plug-in can fail over quickly.

However, the timeout value on some of the operating systems is not only used for outgoing traffic (from Web server to appserver) but also for incoming traffic. This means that any changes to this value will also change the time it takes for clients to connect to your Web server. If clients are using dial-up or slow connections, and you set this value too low, they will not be able to connect.

To overcome this problem, WAS V5.0 offers an option within the plug-in configuration file that allows you to bypass the operating system timeout.

It is possible to change an attribute to the Server element called ConnectTimeout, which makes the plug-in use a non-blocking connect. Setting ConnectTimeout to a value of zero (default) is equal to not specifying the ConnectTimeout attribute, that is, the plug-in performs a blocking connect and waits until the operating system times out. Set this attribute to an integer value greater than zero to determine how long the plug-in should wait for a response when attempting to connect to a server. A setting of 10 means that the plug-in waits for 10 seconds to time out.

To determine what setting should be used, you need to take into consideration how fast your network and servers are. Complete some testing to see how fast your network is, and take into account peak network traffic and peak server usage. If the server cannot respond before the ConnectTimeout, the plug-in will mark it as down.

Since this setting is determined on the Server tag, you can set it for each individual cluster member. For instance, you have a system with four cluster members, two of which are on a remote node. The remote node is on another subnet and it sometimes takes longer for the network traffic to reach it. You might want to set up your cluster as shown in Example 5-21.

Example 5-21 ConnectTimeout Server attribute in plugin-cfg.xml file

<ServerCluster CloneSeparatorChange="false" LoadBalance="Round Robin" Name="PluginCluster" PostSizeLimit="-1" RemoveSpecialHeaders="true" RetryInterval="60">
      <Server CloneID="v544d031" ConnectTimeout="0" ExtendedHandshake="false" LoadBalanceWeight="8" MaxConnections="-1" Name="was1node_PluginMember1" WaitForContinue="false">
         <Transport Hostname="app1.itso.ibm.com" Port="9088" Protocol="http"/>
      </Server>
<Server CloneID="v544d0o0" ConnectTimeout="20" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="was2Node_PluginMember2" WaitForContinue="false">
         <Transport Hostname="app2.itso.ibm.com" Port="9086" Protocol="http"/>
      </Server>
      <Server CloneID="v54deevk" ConnectTimeout="10" ExtendedHandshake="false" LoadBalanceWeight="2" MaxConnections="-1" Name="was3node_PluginMember3" WaitForContinue="false">
         <Transport Hostname="app3.itso.ibm.com" Port="9093" Protocol="http"/>
      </Server>
      <PrimaryServers>
         <Server Name="was1node_PluginMember1"/>
         <Server Name="was2Node_PluginMember2"/>
         <Server Name="was3node_PluginMember3"/>
      </PrimaryServers>
   </ServerCluster>

PluginMember1 in Example 5-21 is on the same machine as the Web server. This means that there is no need to use a non-blocking connect. PluginMember2 is on a remote server in a slower part of the network. So PluginMember2 has a higher ConnectTimeout setting to compensate for this. Finally, PluginMember3 is on a faster part of the network, so it is safer to set the ConnectTimeout to a lower value.

If a non-blocking connect is used, you will see a slightly different trace output. Example 5-22 shows what you see in the plug-in trace if a non-blocking connect is successful.

Example 5-22 Plug-in trace when ConnectTimeout is set

...
TRACE: ws_common: websphereGetStream: Have a connect timeout of 10; Setting socket to not block for the connect
TRACE: errno 55
TRACE: RET 1
TRACE: READ SET 0
TRACE: WRITE SET 32
TRACE: EXCEPT SET 0
TRACE: ws_common: websphereGetStream: Reseting socket to block
...

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.