大网数据广告活动
服务器运维问答

how to decently configure net.ipv4.neigh.default.gc_thresh_n

· 52CE 我爱测

We recently had a storm of kernel: neighbour: arp_cache: neighbor table overflow! errors on some nodes of our kubernetes cluster. After research we've figured out that we needed to bump our servers net.ipv4.neigh.default.gc_thres…

问题原文

原帖链接 · vinni_f · CC BY-SA 4.0

We recently had a storm of kernel: neighbour: arp_cache: neighbor table overflow! errors on some nodes of our kubernetes cluster.

After research we've figured out that we needed to bump our servers net.ipv4.neigh.default.gc_thresh{1,2,3} to match the needs of some of the new applications that have recently been added to our cluster.

While doing some research I was not able to find any decent way to calculate what would be the best suited values to put there.

How does one figures out what should be set there?

已采纳解答

原帖链接 · vinni_f · CC BY-SA 4.0

Here is what I ended up doing:

Collected data from all the servers with that:

for n in ip netns; do echo -en "$n: "; sudo ip netns exec $n arp -an|wc -l; done 2>&1 | grep -v 'No such file or directory' > /tmp/arp.log

count=0for i in cat /tmp/arp.log|awk '{ print $2 }'; do count=expr $count + $i; done

echo $count

rm -f /tmp/arp.log

Figured out my top value, doubled that and that number is my new gc_thresh3.

NOTE: Something that is not accounted for in the last commands is that some containers are using the host network so that means that the actual amount of entries in the table is probably lower. Since the hit on the RAM is insignificant I didn't care about that.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。