How to increase the efficiency of UDP packet collection

Source: Internet
Author: User

Reference articles

Http://ref.onixs.biz/lost-multicast-packets-troubleshooting.html

Operating System Kernel Network buffers tuning

Operating system kernel Network buffer tuning

Linux

Run the command to check the current settings of the sysctl -A | grep net | grep ‘mem\|backlog‘ | grep ‘udp_mem\|rmem_max\|max_backlog‘ system level buffers.

For example:

Net.core.rmem_max = 131071
Net.core.netdev_max_backlog = 1000
Net.ipv4.udp_mem = 1501632 2002176 3003264

Increase the maximum socket receive buffer size to 32MB:

Increase the maximum socket receive buffer size to 32MB:


sysctl -w net.core.rmem_max=33554432

Increase the maximum total buffer-space allocatable. This is measured in units of pages (4096 bytes):

Increase the total amount of buffer space that can be allocated, values in pages, per page unit equals 4096 bytes:
sysctl -w net.ipv4.udp_mem="262144 327680 393216"

Note net.ipv4.udp_mem that works in pages, so to calculate the size of bytes multiply values by page_size, where page_size = 4096 (4K ). Then the on max udp_mem size bytes is 385152 * 4096 = 1,577,582,592.

Increase the queue size for incoming packets:

Increase the Receive packet queue size:
sysctl -w net.core.netdev_max_backlog=2000

To apply the changes, run the sysctl -p command.

Check the new settings by running the sysctl -A | grep net | grep ‘mem\|backlog‘ | grep ‘udp_mem\|rmem_max\|max_backlog‘ command again.

How to increase the efficiency of UDP packet collection

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.