Get the App
SLTechnology News&Howtos  ›  Servers  › 

The solution to the problem of Home connection timeout

Shulou Source: shulou.com Published: 2022-06-03 07:45:45 10月06日 Update

This morning, I found that the new home node reported an error and could not be connected, and some nodes found problems, indicating that the service problem was unlikely, so I thought it was the kernel parameter problem. Sure enough, because it is a new node, there is no optimization of the system. Now is the time to find the problem and record the process:

1. Check the connection status and summarize it.

Netstat-n | awk'/ ^ tcp/ {+ + S [$NF]} END {for (an in S) print a, S [a]}'

CLOSE_WAIT 42

ESTABLISHED 0

TIME_WAIT 1006

2. Optimize kernel parameters first

Vi / etc/sysctl.conf

Net.ipv4.tcp_syncookies = 1

Net.ipv4.tcp_tw_reuse=1 # allows TIME_WAIT status to be reused so that even if TIME_WAIT occupies all ports, it does not reject new requests and cause obstacles. The default is 0.

Net.ipv4.tcp_tw_recycle=1 # Let TIME_WAIT recycle default 0 as soon as possible

Net.ipv4.tcp_fin_timeout=30

/ sbin/sysctl-p # let the parameter take effect

3. Restart related java services

Although this is the common sense of the operation and maintenance staff to find the problem, it may be forgotten because of the change of environment. Record it here.

Tags: Problem parameter node kernel state service home page unlikely possibility common sense environment port system process this is part obstacle change method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information vpn Redmi MySQL Huawei