![](/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.