初装Linux网络优化

来源:岁月联盟 编辑:exp 时间:2011-10-15

Linux系统初装后TCP memory默认参数配置为128K,在过多进程负载网络通信的情况下就会出现异常。
可以使用命令扩大使用内存: www.2cto.com
#sysctl -w net.core.rmem_max=16777216
#sysctl -w net.core.wmem_max=16777216
##修改为16M
最好同时修改 /etc/sysctl.conf文件,保证系统正常运行:
# These ensure that TIME_WAIT ports either get reused or closed fast.
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_tw_recycle = 1
# TCP memory
net.core.rmem_max = 16777216
net.core.rmem_default = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 262144

摘自:黑黑的窝