All Products
Search
Document Center

:Linux instance TCP backlog cache overflow caused by failure to connect to instance remotely

Last Updated:Sep 12, 2024

Note

Disclaimer: this article may be contributed by the community or involve third-party product information, we recommend that you visit the community or the official website of third-party products for help and support. Third-party products will not be provided by Alibaba Cloud after-sales support. This document is for reference only. Alibaba Cloud makes no guarantee by express or any other means.

Problem description

If the TCP backlog cache overflows in a Linux instance, the network performance of the instance may be affected, and the instance cannot connect remotely.

Cause

May be caused by the following reasons:

  • The values of /etc/sysctl.conf and net.core.somaxconn in the net.ipv4.tcp_max_syn_backlog file are too low. The /etc/sysctl.conf file stores system configuration information. If parameters are incorrectly configured, the network performance of Linux instances may be affected.

  • The backlog parameter of the application is improperly set.

Solution

Note

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.

  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.

  • If you have granted permissions on the Alibaba Cloud platform or submitted security information such as the logon account and password, we recommend that you modify the information as soon as possible.

Select the following steps based on the on-site conditions.

Modify the /etc/sysctl.conf file

  1. Remotely log on to the Linux instance through VNC. For more information about how to log on remotely, see ECS connection methods overview.

  2. Run the following command to edit the /etc/sysctl.conf file:

    Note

    Note: back up the data before modifying the configuration file.

    vim /etc/sysctl.conf

  3. Press A to adjust the values of net.core.somaxconn and net.ipv4.tcp_max_syn_backlog parameters as needed. Then, press Esc to exit the edit mode. Enter :wq and press Enter. Save and exit.

    Note

    Description

    • :wq in colon : Need to press Shift+: Key output.

    • Modify the value of the net.core.somaxconn parameter. In this topic, 1024 is used as an example. Adjust the value as needed.

    • In this topic, the value of the net.ipv4.tcp_max_syn_backlog parameter is modified as 5000.

    A similar output is displayed. {001E9C08-86CA-4A04-9BA5-1B43A5ECC4A3}_20200720113009.jpg

  4. Run the following command to make the configuration take effect.

    sysctl -p

Modify the backlog parameter of an application

You can modify the backlog parameter of the application as needed.

Application scope

  • Elastic Compute Service