How to monitor Linux UDP buffer available space?

Source: Internet
Author: User

How to monitor Linux UDP buffer available space?

you is trying to solve the wrong problem. UDP is  unreliable   communication, period. If packet loss is a problem for you, you should either implement your own Retransmission/error control algorithm or not us ing UDP in the first place. Drop it entirely in favor of TCP, or perhaps something more advanced like SCTP or even DCCP.

UDP is datagram-based, socket buffers should be bigger than the maximum length of a UDP datagram that your application m Ay receive, up to 64kiB. If your application may transmit datagrams larger than this and then it's another reason you should isn't be using UDP. And it really doesn ' t matter how big was the buffer, you still may lose packets if your application can ' t read the socket F Aster than packets arrive.

You say this want to know "how full" the UDP buffer is. This is the sort of thing that doesn ' t really matter. Just read everything that's waiting on the buffer and you can being sure that when it blocks the buffer would be empty.

If you still want to know how full the buffer is, the read the file /proc/net/udp ,

             1. column  rx_queue

2. Column Tx_queue is the same to Rx_queue


/PROC/NET/TCP is TCP info

How to monitor Linux UDP buffer available space?

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.