Consultor Eletrônico



Kbase P20653: Managing AppServer TCP/IP Resources on Windows
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/07/2009
Status: Verified

GOAL:

Managing AppServer TCP/IP Resources on Windows

FACT(s) (Environment):

Windows NT 32 Intel/Windows 2000
Progress 9.x
OpenEdge 10.x

FIX:

The AppServer is designed for a world in which you connect to the AppServer and stay connected for the life of your application. If you do not use the AppServer in this manner but instead do a constant series of "Connect, Run a Program, Disconnect" iterations you will eventually get connection failures when trying to connect to the AppServer.

This is caused by the way TCP/IP sockets are handled by default.

The normal behavior of sockets in TCP/IP is that when you disconnect from a socket the socket goes into a "wait state" for four (4) minutes during which time the socket is not available for reuse.

This four (4) minute delay is done to make sure that any "loose" packets out on the network are properly flushed away (i.e. TCP/IP makes sure that once the socket is reused it doesn't get a packet from a previous connection).

On Windows NT, the number of dynamically allocated ports available for use are approximately 4,000 (port numbers from 1024 to 5000). Interestingly, even though roughly 4,000 ports appear to be available NT only uses the odd numbered ports so you really only have 2,000 ports available for use.

In a scenario where you are constantly connecting and disconnecting it is quite easy to use up all of the available ports which in turn will cause connection failures when trying to connect to the AppServer.

To resolve this problem you can use either of the following:

1) Modify your application code so that you do not constantly
connect to and then disconnect from the AppServer. This solution
is strongly recommended because doing constant connect/disconnect
iterations will drastically reduce the throughput you can achieve
with the AppServer.

For example, to do the following requires 14 trips across the
network for Progress and another 5 to 6 one way trips across the
network for TCP/IP itself:

A) Connect to the AppServer.
B) Run a Program non-persistently.
C) Disconnect from the AppServer.

By connecting to the AppServer and staying connected only step B
above would need to happen during each iteration and this would
only require two (2) trips across the network instead of the 19
to 20 trips required in the connect/run/disconnect scenario.


2) Make the modifications shown below to the registry. Please note
that this *may* not entirely resolve the problem but will lessen
it to a large degree:

A) Add the following DWORD values to the registry:

1) TcpTimedWaitDelay (value = decimal 30)

This entry tells NT to wait only 30 seconds before making
a socket available for reuse (instead of the default of
240 seconds)

2) MaxUserPort (value = decimal 65534)

This entry tells NT to use port numbers from 1024 to
65534 for dynamic port allocation. This will increase
the number of available ports from 2,000 to 32,000.

Please note that both of these entries should be added to
the following key:>
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\ (continued)
Services\Tcpip\Parameters
.