Tune TCP time wait interval for high-load environments (HP-UX, Linux, Solaris, Windows)

转载:http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.edge.doc%2Fedge%2Fcp%2Fadmingd45.htm

The TCP time wait interval specifies the length of time that a socket waitsfor a FIN packet from the sender before forcibly closing. In high-load environments,the proxy server may appear to stall if a large number of sockets remain suspendedin the TIME_WAIT state after their connections are closed. Reducing the TCPtime wait interval will reduce the number of suspended sockets and, in high-loadenvironments, may prevent the proxy server from appearing to stall. It is recommendedthat this interval be set to 5 seconds.

To set the TCP time wait interval to 5 seconds:

  • On HP-UX:

    Issue the following command:

    ndd /dev/tcp -set tcp_time_wait_interval 5000

    Use the "sam" utility to set the kernel parameter max_thread_procto at least 2048.

    Note:
    Also consider adjusting the following kernelparameters: maxfiles, maxfiles_lim, maxproc, shmem, tcp_conn_request_max,tcp_ip_abort_interval, tcp_keepalive_interval, tcp_rexmit_interval_initial,tcp_rexmit_interval_max, tcp_rexmit_interval_min, tcp_xmit_hiwater_def, tcp_recv_hiwater_def.
  • On Linux:

    Issue the following commands:

    echo "1024 61000" > /proc/sys/net/ipv4/ip_local_port_range
    echo "5" > /proc/sys/net/ipv4/tcp_fin_timeout
  • On Solaris:

    Issue the following command:

    ndd /dev/tcp -set tcp_time_wait_interval 5000

    Edit the /etc/system file to read as follows::

    set tcp:tcp_conn_hash_size=8129
  • On Windows:

    A registry entry must be created set a TCP time wait interval.Refer to your Windows documentation for more information.


你可能感兴趣的:(Tune TCP time wait interval for high-load environments (HP-UX, Linux, Solaris, Windows))