Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Count the number of Linux server connections

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Security code: it is impossible to have inner peace without a considerable degree of loneliness.

By understanding the state of TCP, it is very helpful to troubleshoot and locate network or system problems. Check the number of connections to the server through the netstat command.

Netstat-an | awk'/ tcp/ {print $6}'| sort | uniq-c 28 CLOSE_WAIT 2 CLOSING 116 ESTABLISHED 28 FIN_WAIT1 12 FIN_WAIT2 4 LAST_ACK 5 LISTEN 72 SYN_RECV 295 TIME_WAIT

Status description CLOSED does not have any connection LISTENING listens for connection requests from remote TCP ports SYN-SENT application has started, open a connection SYN-RECEIVED a connection request has arrived, waiting for confirmation that ESTABLISHED represents an open connection FIN-WAIT-1 waiting for a remote TCP connection break request Or confirmation of a previous connection break request FIN-WAIT-2 from the remote TCP waiting for a connection break request CLOSE-WAIT waiting for a connection break request sent from a local user CLOSING waiting for a remote TCP confirmation of a connection break LAST-ACK waiting for the original confirmation of a connection break request sent to the remote TCP wait enough time to ensure that the remote TCP receives an acknowledgement of the connection break request

1. The status of the client can be represented by the following process:

CLOSED- > SYN_SENT- > ESTABLISHED- > FIN_WAIT_1- > FIN_WAIT_2- > TIME_WAIT- > CLOSED

2. The status of the server can be represented by the following process:

CLOSED- > LISTEN- > SYN_RECEIVED- > ESTABLISHED- > CLOSE_WAIT- > LAST_ACK- > CLOSED

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report