首页 > 其他 > 详细

如何增大UDP收包效率

时间:2015-11-18 22:57:46      阅读:495      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!