Linux connection count status Statistics

Source: Internet
Author: User
Statistics on the number of connections in linux connection status: netstat has poor performance when the number of connections exceeds 4 W. Let's take a look at the ss command: ss-t-a # count all TCP connections ss-u-a # count all UDP connections ss also has the filter function, the following lists the common functions: ssstate... statistics on the number of connections in linux connection status: netstat has poor performance when the number of connections exceeds 4 W. First look at the ss command: ss-t-a # count all TCP connections ss-u-a # count all UDP connections
Ss also has the filtering function. The following lists common functions: ss state ESTABLISHED # List all connections in the ESTABLISHED state ss-t-a-o excl ESTABLISHED # exclude all connections in the ESTABLISHED state
Ss state ESTABLISHED sport eq: 80 # List all connections in the status of ESTABLISHED on port 80. ss state ESTABLISHED sport eq: 80 and not dst 127.0.0.1 # List all connection ss commands in the status of ESTABLISHED and the destination address is not 127.0.0.1 on port 80 from the iproute package. Ss-s lists some basic statistics: # ss-sTotal: 43160 (kernel 43254) TCP: 43770 (estab 43069, closed 32, orphaned 646, synrecv 0, timewait 24/0), ports 285 Transport Total IP IPv6 * 43254-RAW 0 0 UDP 13 10 3 TCP 43738 43535 203 INET 43751 43545 206 FRAG 0 0 0TCP :? 43770? (Estab 43069 ,? Closed 32 ,? Orphaned 646 ,? Synrecv 0 ,? Timewait 24/0 ),? What does this line of ports 285 mean? you can only find it in the source code :... printf ("TCP: % d (estab % d, closed % d, orphaned % d, synrecv % d, timewait % d/% d), ports % d \ n ", s. tcp_total + slabstat. tcp_syns + s. tcp_tws, sn. tcp_estab, s. tcp_total-(s. tcp4_hashed + s. tcp6_hashed-s.tcp_tws), s. tcp_orphans, slabstat. tcp_syns, s. tcp_tws, slabstat. tcp_tws, slabstat. tcp_ports );

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.