正在检查登录状态... | 繁體中文 | 设为首页 | 加入收藏
点击:645 | 评论:0 | 辅助功能: 复制 | 打印 | 字体: | |

RHEL5网络参数优化

作者: 蓝天下云层上 发表于 最后更新于
版权声明:转载请征求作者同意,转载时必以超链接形式标明文章原始出处和作者信息及版权声明。
/blog/weblog-20565-1.html
使用netstat -ant|grep TIME_WAIT|wc -l查看等待请求数量。

vi /etc/sysctl.conf,加入以下参数,保存后使用/sbin/sysctl -p命令使设置生效或重启机器。

#old
net.ipv4.tcp_keepalive_probes = 9
#new 减少超时前的探测次数
net.ipv4.tcp_keepalive_probes = 5

#old
net.ipv4.tcp_keepalive_intvl = 75
#new 确定两次 isAlive 时间间隔探测之间的等待时间
net.ipv4.tcp_keepalive_intvl = 15

#old
net.core.netdev_max_backlog = 1000
net.core.somaxconn = 128
#new 调整系统同时发起连接的tcp连接数
net.core.netdev_max_backlog = 3000
net.core.somaxconn = 3000

#old
net.ipv4.tcp_keepalive_time = 7200
#new 减少TCP KeepAlive连接侦测的时间,使系统可以处理更多的连接
net.ipv4.tcp_keepalive_time = 1800

#old
net.ipv4.tcp_max_syn_backlog = 1024
#new 增加TCP SYN队列长度,使系统可以处理更多的并发连接
net.ipv4.tcp_max_syn_backlog = 8192

#old
net.ipv4.tcp_fin_timeout = 60
#new 减少处于FIN-WAIT-2连接状态的时间,使系统可以处理更多的连接
net.ipv4.tcp_fin_timeout = 30

#old
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_recycle = 0
#new 打开TIME-WAIT套接字重用功能,对于存在大量连接的Web服务器非常有效
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

#old
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
#new 优化TCP接收/发送缓冲区
net.ipv4.tcp_rmem = 8192 4194304 8388608
net.ipv4.tcp_wmem = 4096 2097152 8388608

#old
net.core.rmem_max = 131071
net.core.wmem_max = 131071
#new 优化系统套接字缓冲区
net.core.rmem_max = 8388608
net.core.wmem_max = 8388608

#old
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 1
#new
net.ipv4.tcp_window_scaling = 0
net.ipv4.tcp_sack = 0
net.ipv4.tcp_timestamps = 0



参考文章:
http://blog.chinaunix.net/u1/38871/showart_2221366.html
http://www.wangchao.net.cn/bbsdetail_1409398.html
http://www.javaeye.com/topic/624598

此日志的引用通告 URL:
http://www.imx365.net/blog/tb.cgi/20565

其实我一直都不知道您在想些什么,有什么感触。说真的,您的评论对于我来说很重要...

还没有人评论过

发表评论
  • (地址不公开)

(访客)