IBM Support

Windows and Linux TCP/IP Tuning/Socket Problem

Question & Answer


Question

You might encounter a "Connection cannot be established" message on the Windows® or Linux operating system on systems that are running the Content Manager OnDemand batch system administration program (ARSXML) and communicating with Content Manager OnDemand servers. The same problem can also occur when loading a large number of documents or when using the OnDemand Web Enablement Kit (ODWEK) API during the search and retrieve operations.

Cause

The IBM Content Manager OnDemand client and server communicate based on transactions. The client opens a socket to communicate with the server and closes that socket when the current transaction completes. During repeated add, delete, modify, search, and retrieve operations that are typically associated with the Content Manager OnDemand batch administration program (ARSXML), ODWEK APIs, and loading documents, a large number of TCPIP sockets are opened and closed.

By default, when a Windows socket is closed by an application, Windows waits 240 seconds before closing and returning it . When a Linux socket is closed by an application, Linux waits 60 seconds before closing it.

During this time, the port that the socket used is placed in the TIME_WAIT state and cannot be reused.

Windows also has a restriction on the highest port number that can be used (5000) when an application requests any available user port from the system.

Linux also has a restriction on the number of available ports that can be used (28232) when an application requests any available user port from the system.

Therefore, the Windows and Linux socket defaults may not accommodate heavy TCP/IP traffic without additional tuning.

Answer

To alleviate this problem on Windows, it is recommended that you change the Windows default values for the following two parameters for systems that run OnDemand Data Loading Server and communicate with Content Manager OnDemand servers.

Important: This solution includes changing the Windows registry with Windows registry editor (regedit). It is strongly recommended that you back up the Windows registry before you make any changes.

To reduce the timeout wait time for closed sockets, change the value of the following registry key from its default of 240 to a smaller number, for example, 30. The valid range is 30-300 (decimal):
HKEY_LOCAL_MACHINE\System\CurrectControlSet\services\Tcpip\Parameters\TcpTimedWaitDelay

To increase the maximum port numbers available to applications, change the value of the following registry key from its default of 5000 (decimal) to a higher number, for example, 65000. The valid range is 5000-65534 (decimal):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort



After making these changes, restart the Windows server for the changes to take effect.

For more information about these two parameters, you can search for TcpTimedWaitDelay and MaxUserPort on Microsoft Technet at:

http://technet.microsoft.com/

To alleviate this problem on Linux, its recommended that you change the Linux default values for the following two parameters for systems that run OnDemand Data Loading Server and communicate with Content Manager OnDemand servers.

Important: This solution requires adjusting Linux kernel parameters. You should make a note of the original values so you can reset them if necessary.

To reduce the timeout wait time for closed sockets, change the value of the kernel parameter from its default of 60 to a smaller number, for example, 30.
sysctl -w net.ipv4.tcp_fin_timeout=30



To increase the maximum number of ports available to applications. Change the value of the kernel parameter from its default of 28232 to a higher wider range, for example, 1024 to 65535.
sysctl -w net.ipv4.ip_local_port_range=1024 65500

The values specified here are just examples, you may have to try different values based on your systems load.

[{"Product":{"code":"SSEPCD","label":"Content Manager OnDemand for Multiplatforms"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"XML","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"9.5;9.0;8.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
17 June 2018

UID

swg21267490