Increase Linux ARP cache size

user-pic
Vote 0 Votes

若在 Linux 使用網路遇到 No Buffer Space avaiable, 就是 ARP cache table 滿了,
預設值是 1024, 若要調大成四倍, 可以下指令
sysctl -w net.ipv4.neigh.default.gc_thresh1=512
sysctl -w net.ipv4.neigh.default.gc_thresh2=2048
sysctl -w net.ipv4.neigh.default.gc_thresh3=4096

加到 /etc/sysctl.conf 可以使下次開機生效
echo "net.ipv4.neigh.default.gc_thresh1=512
net.ipv4.neigh.default.gc_thresh2=2048
net.ipv4.neigh.default.gc_thresh3=4096" >> /etc/sysctl.conf

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. Defaults to 128.
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. Defaults to 512.
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. Defaults to 1024.

ref. Manage of ARP

2 Comments

| Leave a comment

的確漏字, 已補上, 謝謝

user-pic

echo第三行好像少了"=4096"?

Leave a comment

About this Entry

This page contains a single entry by Pank published on March 22, 2011 2:18 PM.

Firefox 4.0 Released and My Extensions was the previous entry in this blog.

Xshell is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives