![](/img/trans.png)
[英]Python loop causing “error: [Errno 105] No buffer space available”
[英]OSError 105 : No buffer Space - Zeroconf
我正在使用 NanoPi M1(Allwinner H3 板)并运行基于 Yocto 的操作系统。 在我第一次遇到 ZeroConf-python 时,
>>> from zeroconf import Zeroconf, ServiceBrowser
>>> zero = Zeroconf()
我收到错误:
File "/usr/lib/python3.5/site-packages/zeroconf.py", line 1523, in __init__
socket.inet_aton(_MDNS_ADDR) + socket.inet_aton(i))
OSError: [Errno 105] No buffer space available
当我在 Raspbian(在 RPI 上)中运行它时,不会出现此错误。 我试图在 homeassistant 中寻找此类错误的修复程序,但没有一个能够很好地概述真正的问题,将解决方案放在一边。
将sysctl
的net/ipv4/igmp_max_memberships
值更新为大于零。 在终端上执行以下命令: $ sysctl -w net.ipv4.igmp_max_memberships=20
(或任何其他大于零的值) & $ sysctl -w net.ipv4.igmp_max_msf=10
然后,重启 avahi-daemon systemctl restart avahi-daemon
您可以使用“sysctl net.ipv4.igmp_max_memberships”验证上述密钥的现有值。
Neelotpal 答案的补充:
这篇 文章包含一个很好的解决方案提案,其中包含检查此问题的所有选项:
# Bigger buffers (to make 40Gb more practical). These are maximums, but the default is unaffected.
net.core.wmem_max=268435456
net.core.rmem_max=268435456
net.core.netdev_max_backlog=10000
# Avoids problems with multicast traffic arriving on non-default interfaces
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.all.rp_filter=0
# Force IGMP v2 (required by CBF switch)
net.ipv4.conf.all.force_igmp_version=2
net.ipv4.conf.default.force_igmp_version=2
# Increase the ARP cache table
net.ipv4.neigh.default.gc_thresh3=4096
net.ipv4.neigh.default.gc_thresh2=2048
net.ipv4.neigh.default.gc_thresh1=1024
# Increase number of multicast groups permitted
net.ipv4.igmp_max_memberships=1024
我不建议只是盲目地复制这些值,而是系统地测试是哪一个限制了您的资源:
sysctl <property>
获取当前设置的值sysctl -w
或通过直接更改/etc/sysctl.conf
并通过sysctl -p
重新加载它来更改 Neelotpal 描述的配置在我的情况下,增加net.ipv4.igmp_max_memberships
就可以了:
sysctl net.ipv4.igmp_max_memberships
检查了当前值为 20netstat -gn
容器占据了其中的大部分当然,阅读这些属性以了解它们的实际作用也是很好的,例如在sysctl-explorer.net上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.