How to view the number of connections to Apache and the current number of connections _linux

Source: Internet
Author: User
Viewed the number of connections and the current number of connections
Copy Code code as follows:

Netstat-ant | grep $IP: 80 | Wc-l
Netstat-ant | grep $IP: 80 | grep EST | Wc-l

View IP access times
Copy Code code as follows:

Netstat-nat|grep ":" |awk ' {print $} ' |awk-f: ' {print $} ' | Sort| Uniq-c|sort-n

Linux command:
Copy Code code as follows:

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

Return sample results:
Last_ack 5
SYN_RECV 30
Established 1597
Fin_wait1 51
Fin_wait2 504
Time_wait 1057

Description
SYN_RECV indicates the number of requests waiting to be processed;
Established indicates normal data transfer status;
Time_wait represents the number of requests that have been processed, waiting for the timeout to end;
FIN_WAIT1 indicates that the server side actively requests the shutdown of the TCP connection;
Fin_wait2 indicates that the client is disconnected;
Last_ack shutting down a TCP connection needs to be shut down in two directions, both by sending the fin to indicate the closure of the single direction data, and when the communication parties send the last fin, the sender is in the Last_ack state at this time, When the sender receives the confirmation of the other party (the ACK of the fin is confirmed), it really shuts down the entire TCP connection;

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.