kern.warning :Neighbour table overflow
这几天查看bug列表的时候,发现一个关于 Neighbour table overflow
相关的bug。
从字面上看应该是内核 ARP 相关的 table cache 用光了,在这种情况下应该增加 ARP table cache 的大小。
那么该如何增加是一个问题,有问题先Google一下。
发现好多关于该问题的解决方法:
大致都是通过 sysctl 命令来修改内核参数来增加 table cache 的大小:
net.ipv4.neigh.default.gc_thresh1
net.ipv4.neigh.default.gc_thresh2
net.ipv4.neigh.default.gc_thresh3
These 3 parameters are defined in the Linux Kernel Code in the header file /include/net/neighbour.h as integer.
Gaia Portal accepts maximal value of 16384.
gc_thresh1
The minimum number of entries to keep in the ARP cache.
The garbage collector will not run if there are fewer than this number of entries in the cache.
gc_thresh2
The soft maximum number of entries to keep in the ARP cache.
The garbage collector will allow the number of entries to exceed this for 5 seconds before collection will be performed.
gc_thresh3
The hard maximum number of entries to keep in the ARP cache.
The garbage collector will always run if there are more than this number of entries in the cache.
In order for the garbage collector to work properly, and not to overload the machine with garbage collections, when changing the gc_thresh3 parameter, user should (note: does not have to) change the gc_thresh2 and gc_thresh1 parameters accordingly.
关于这几个参数的解释在 kernel: neighbour table overflow 中有详细的解释。
而在Linux: Neighbour Table Overflow Error and Solution中,介绍的方法
Solving neighbour table overflow errors (large subnets)中介绍了在子网很多的时候如何设置这些参数。
https://github.com/freifunk-gluon/gluon/issues/83
综上关于这个问题主要是修改这几参数,通过不同的参数调节,可以达到用户的不同要求。