WARNING UDP The recv buffer could not be resized sufficiently. Target sock buff size: 250000000 bytes. Actual sock buff size: 212992 bytes. See the transport application notes on buffer resizing. Please run: sudo sysctl -w net.core.rmem_max=250000000 WARNING UDP The send buffer could not be resized sufficiently. Target sock buff size: 250000000 bytes. Actual sock buff size: 212992 bytes. See the transport application notes on buffer resizing. Please run: sudo sysctl -w net.core.wmem_max=250000000 WARNING UDP The current recv_buff_size of 212992 is less than the minimum recommended size of 307200 and may result in dropped packets on some NICs WARNING UDP The current send_buff_size of 212992 is less than the minimum recommended size of 307200 and may result in dropped packets on some NICs
🔧 临时解决方法(当前会话有效)
在 Spark 机器上(root 权限)执行:
sudo sysctl -w net.core.rmem_max=250000000
sudo sysctl -w net.core.wmem_max=250000000
可以先看看现在的值:
sysctl net.core.rmem_max
sysctl net.core.wmem_max
改完后再跑 USRP 程序,一般这些 WARNING 就会消失。
注意:这是"内核最大值",UHD 仍然会按自己设定去申请 buffer,申请值不能超过这个上限。
🔁 持久化配置(重启后也生效)
编辑 /etc/sysctl.d/uhd.conf(文件名随便,只要在这个目录里即可):
sudo nano /etc/sysctl.d/uhd.conf
写入:
net.core.rmem_max = 250000000
net.core.wmem_max = 250000000
保存后执行:
sudo sysctl --system
这样以后开机就自动是这个配置。