Help Center/ Virtual Private Cloud/ FAQs/ Connectivity/ Why Are There Intermittent Interruptions When a Local Host Accesses a Website Built on an ECS?
Updated on 2022-09-26 GMT+08:00

Why Are There Intermittent Interruptions When a Local Host Accesses a Website Built on an ECS?

Symptom

After you build a website on an ECS, some users occasionally are unable to access the website through the local network.

Troubleshooting

  1. Check the local network of the user.

    If the local host communicates with the ECS using NAT, this problem may occur.

  2. Run the following command to check whether tcp_tw_recycle is enabled on the ECS:

    sysctl -a|grep tcp_tw_recycle

    If the value of tcp_tw_recycle is 1, the function is enabled.

  3. Run the following command to check the number of lost packets of the ECS:

    cat /proc/net/netstat | awk '/TcpExt/ { print $21,$22 }'

    If the value of ListenDrops is not 0, there is packet loss, that is, the network is faulty.

Procedure

This problem can be solved by modifying the kernel parameters of the ECS.
  • Run the following command to temporarily modify the parameters (the parameters will change back after a restart):

    sysctl -w net.ipv4.tcp_tw_recycle=0

  • Perform the following operations to permanently modify the parameters:
    1. Run the following command and modify the /etc/sysctl.conf file:

      vi /etc/sysctl.conf

      Add the following content to the file:

      net.ipv4.tcp_tw_recycle=0

    2. Press Esc, enter :wq!, and save the file and exit.
    3. Run the following command to make the modification take effect:

      sysctl -p