linux 内核调优记录-khls27-ChinaUnix博客
/etc/sysctl.conf 在这个文件中修改,如果不存在可以写入:
echo "net.ipv4.neigh.default.gc_thresh2 = 20480" >>/etc/sysctl.conf
echo "net.ipv4.neigh.default.gc_thresh3 = 40960" >>/etc/sysctl.conf
如果存在:
sed -i 's/^net.ipv4.neigh.default.gc_thresh2 = .*/ net.ipv4.neigh.default.gc_thresh2 = 2048/g' /etc/sysctl.conf
sed -i 's/^net.ipv4.neigh.default.gc_thresh3 = .*/ net.ipv4.neigh.default.gc_thresh3 = 4096/g' /etc/sysctl.conf
查看是否改了:
cat /etc/sysctl.conf |grep net.ipv4.neigh.default.gc_thresh
生效:
sysctl -p