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