No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

eSight V300R009C00 Single-Node System Software Installation Guide (SUSE Linux) 09

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
How Do I Reduce the Time for Canceling TCP Connections in TIME_WAIT State on Linux

How Do I Reduce the Time for Canceling TCP Connections in TIME_WAIT State on Linux

Question

In a large-scale Linux environment, a large number of Transmission Control Protocol (TCP) connections in TIME_WAIT state exist after Nginx reverse proxy service is adopted. By default, TCP connections in TIME_WAIT state are canceled in 2 minutes, which reduces system throughputs. How do I modify the kernel parameters of Linux to reduce the time for canceling TCP connections in TIME_WAIT states and increase the upper limit of nf_conntrack?

Answer

  1. Log in to the Linux OS as the root user.

    NOTE:

    Remotely log in to the server as the ossuser and switch to the root user if the SUSE Linux is hardened.

  2. Modify the configuration file to modify the kernel parameters of Linux.

    1. Switch to the /etc directory.

      # cd /etc

      NOTE:

      / is the root directory of Linux.

    2. You are advised to back up the configuration file sysctl.conf before modifying it. If the backup file name is sysctl.conf_bak, run the following command to back up the file:

      # cp sysctl.conf sysctl.conf_bak

    3. Open the sysctl.conf file in text mode.

      # vi sysctl.conf

    4. Add the following contents to the sysctl.conf file:
      net.ipv4.tcp_syncookies = 1 
      net.ipv4.tcp_tw_reuse = 1 
      net.ipv4.tcp_tw_recycle = 1 
      net.ipv4.tcp_timestamps = 1 
      net.ipv4.tcp_fin_timeout = 30 
      net.nf_conntrack_max = 655360 
      net.netfilter.nf_conntrack_tcp_timeout_established  = 1200     
      NOTE:

      Set net.ipv4.tcp_tw_recycle to 0 in the NAT environment and to 1 in other environments.

    5. Run the following command for the parameters to take effect:

      # /sbin/sysctl -p

Download
Updated: 2019-05-17

Document ID: EDOC1100011860

Views: 92750

Downloads: 138

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next