码迷,mamicode.com
首页 > 其他好文 > 详细

如何增大UDP收包效率

时间:2015-11-18 23:00:11      阅读:1711      评论:0      收藏:0      [点我收藏+]

标签:

参考文章

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

 

Operating system kernel network buffers tuning

操作系统内核网络缓冲区调优

Linux

Run the sysctl -A | grep net | grep ‘mem\|backlog‘ | grep ‘udp_mem\|rmem_max\|max_backlog‘ command to check the current settings of the 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: 

增加最大socket接收缓冲区大小为32MB:


sysctl -w net.core.rmem_max=33554432

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

增加最大可分配的缓冲区空间总量,数值以页面为单位,每个页面单位等于4096 bytes:
sysctl -w net.ipv4.udp_mem="262144 327680 393216"

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

Increase the queue size for incoming packets: 

增加接收数据包队列大小:
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.

 

如何增大UDP收包效率

标签:

原文地址:http://www.cnblogs.com/wedata/p/4975937.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!