Linux netstat commands to see how the number of concurrent connections _linux

Source: Internet
Author: User

Introduced

The number of concurrent connections refers to the ability of a firewall or proxy server to handle its business information flow, is the maximum number of point-to-point connections that a firewall can handle at the same time, reflecting the ability of the firewall device to access and link state tracking for multiple connections, and the size of this parameter directly affects the maximum amount of information that the firewall can support.

Implementation methods

Use the following command to group A view of the various connection states OH:

Netstat-n | awk '/^tcp/{++s[$NF]} end {for (a in S) print A, s[a]} '
Explanation:

Return result Example: 
last_ack 5  (number of requests waiting to be processed) 
SYN_RECV 
established 1597 (normal data transfer status) 
FIN_WAIT1 51 
Fin_wait2 504 
TIME_WAIT 1057 (processing completed, waiting for the end of the number of requests) 
 
status: Description 
CLOSED: No connection is active or in progress 
LISTEN: The server is waiting to enter the call 
Syn_ RECV: A connection request has arrived, waiting for confirmation 
syn_sent: Application has started, open a connection 
established: Normal data transfer status 
fin_wait1: Application says it's done 
Fin_ WAIT2: The other side has agreed 
to release itmed_wait: Wait for all the groupings 
to die CLOSING: Both sides try to close 
time_wait: The other side has initialized a release 
last_ ACK: Wait for all groups to die

Using the above command, you can view the server's connection state, where established is the number of concurrent connection states displayed. If you don't want to see so many connection states and just want to see the number of concurrent connections, you can simplify the command:

Netstat-nat|grep established|wc-l
1164

The number returned is the current number of concurrent connections.

Summarize

The above is the entire content of this article, I hope the content of this article for everyone's study or work to bring certain help, if you have questions you can message exchange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.