Check the socket status in Linux

Source: Internet
Author: User

Check the socket status in Linux:
CAT/proc/NET/sockstat # (IPv4)

Sockets: used 137 TCP: inuse 49 orphan 0 TW 3272 alloc 52 mem 46udp: inuse 1 mem 0raw: inuse 0 frag: inuse 0 memory 0

Note:
Sockets: used: Total number of used protocol sockets
TCP: inuse: number of TCP sockets in use (Listening. The value is ≤netstat-lnt | grep ^ TCP | WC-l
TCP: orphan: number of TCP connections without a master (not in any process) (useless, number of TCP sockets to be destroyed)
TCP: TW: number of TCP connections waiting to be disabled. The value is equal to netstat-ant | grep time_wait | WC-l
TCP: alloc (allocated): number of TCP sockets allocated (established and applied to sk_buff. The value is equal to netstat-ant | grep ^ TCP | WC-l
TCP: Mem: Socket buffer usage (Unit unknown. In SCP measurement, when the speed is 4803.9kb/s: the value is 11. In netstat-ant, the corresponding port 22's Recv-q = 0, send-Q ≈ 400)
UDP: inuse: number of UDP sockets in use
Raw:
Frag: number of IP segments used

For IPv6, see CAT/proc/NET/sockstat6.

Tcp6: inuse 3udp6: inuse 0raw6: inuse 0 frag6: inuse 0 memory 0

With these values, you can easily calculate the current number of TCP requests and perform related monitoring.

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.