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.confandnet.core.somaxconnin thenet.ipv4.tcp_max_syn_backlogfile are too low. The/etc/sysctl.conffile 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
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
Remotely log on to the Linux instance through VNC. For more information about how to log on remotely, see ECS connection methods overview.
Run the following command to edit the
/etc/sysctl.conffile:NoteNote: back up the data before modifying the configuration file.
vim /etc/sysctl.confPress A to adjust the values of
net.core.somaxconnandnet.ipv4.tcp_max_syn_backlogparameters as needed. Then, press Esc to exit the edit mode. Enter:wqand pressEnter. Save and exit.NoteDescription
:wqin colon:Need to pressShift+:Key output.Modify the value of the
net.core.somaxconnparameter. In this topic,1024is used as an example. Adjust the value as needed.In this topic, the value of the
net.ipv4.tcp_max_syn_backlogparameter is modified as5000.
A similar output is displayed.
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