windows下发送UDP包大于1024时速度下降

问题描述:
windows下发送UDP数据包时,包大小为1024时发送速度很快,当设为1025时发送速度骤然下降,导致TS流视频在包长为1316发送时,码率一直很低
 
问题定位:
windows系统特性问题,具体说明如下:
When a Windows Media Server uses UDP to stream, ASF files that are encoded at bit rates equal to or greater than 100 kilobytes per second (Kbps), the size of the transmitted packets is usually greater than 1024 bytes. When the packet size is less than or equal to 1024 bytes, the data is sent directly. If it is above 1024 bytes, the data is locked and buffered and waits until TCP/IP is done sending the data. In the second case, the number of context switches increases enormously and prevents the server from using all the bandwidth available.
 
问题解决:
windows下修改注册表即可,说明如下:
To resolve this problem, do the following:
Start Registry Editor (Regedt32.exe).
Locate the following key in the registry:
HKLM\System\CurrentControlSet\Services\Afd\Parameters
On the Edit menu, click Add Value, and then add the following registry value:
Value Name: FastSendDatagramThreshold
Data Type: REG_DWORD
Value: 1500
Quit Registry Editor.
This value contains the new threshold (in bytes) at which Winsock changes its behavior regarding UDP packets. Values such as 1500 or 2048 should help to dramatically increase the amount of usable bandwidth for streaming ASF files with 100 kilobits or greater bit rates. For higher bit rates, it may be necessary to set higher values for this key. Because it is possible that side effects may occur, this change should be carefully monitored.
 
相关文档链接:
https://support2.microsoft.com/viewkb/viewkb.aspx?contentid=235257
 
注意事项:
注册表修改后,当发送报文量大并且频繁时会引起CUP频繁切换上下文,而且影响系统的可用宽带
 
linux平台相关:
未找到相关文档说明,待测试
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值