View external IP addresses by number of FreeBSD statistics

Source: Internet
Author: User

Server statistics:

1) count the number of connections on port 80

Netstat-Nat | grep-I "80" | WC-l

1

2) count the number of httpd connections

PS-Ef | grep httpd | WC-l

1

3) collect statistics on connected instances in the "established" status'

Netstat-Na | grep established | WC-l

2

4) Find out which IP Address has the most connections and seal it.

Netstat-Na | grep established | awk '{print $5}' | awk-F: '{print
$1} '| sort | uniq-c | sort-R + 0n
Netstat-Na | grep SYN | awk '{print $5}' | awk-F:
'{Print $1}' | sort | uniq-c | sort-R + 0n

Netstat Quick View of TCP connections
Netstat-N | awk '/^ TCP/{++ s [$ NF]} end {for (a in
S) print a, s [a]}'
Man netstat can be used to understand the significance of syn_rcvd. Syn_rcvd indicates the current unfinished tcp syn queue

Run the following command:

# Netstat-an | grep SYN | WC-l

$ Netstat-an | grep syn_recv | WC
97 582 7857
$ Netstat-an |
Grep 80 | WC
916 5500 74164

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.