Chinaunix首页 | 论坛 | 博客
  • 博客访问: 420977
  • 博文数量: 86
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 822
  • 用 户 组: 普通用户
  • 注册时间: 2012-12-25 10:36
文章分类

全部博文(86)

文章存档

2022年(1)

2021年(3)

2020年(1)

2019年(9)

2018年(24)

2017年(20)

2016年(20)

2015年(8)

我的朋友

分类: LINUX

2016-11-30 17:07:37

网络优化
1)      优化系统套接字缓冲区
net.core.rmem_max=16777216
net.core.wmem_max=16777216
2)      优化TCP接收/发送缓冲区
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
3)      优化网络设备接收队列
net.core.netdev_max_backlog=3000
4)      关闭路由相关功能
net.ipv4.conf.lo.accept_source_route=0
net.ipv4.conf.all.accept_source_route=0
net.ipv4.conf.eth0.accept_source_route=0
net.ipv4.conf.default.accept_source_route=0
 
net.ipv4.conf.lo.accept_redirects=0
net.ipv4.conf.all.accept_redirects=0
net.ipv4.conf.eth0.accept_redirects=0
net.ipv4.conf.default.accept_redirects=0
 
net.ipv4.conf.lo.secure_redirects=0
net.ipv4.conf.all.secure_redirects=0
net.ipv4.conf.eth0.secure_redirects=0
net.ipv4.conf.default.secure_redirects=0
 
net.ipv4.conf.lo.send_redirects=0
net.ipv4.conf.all.send_redirects=0
net.ipv4.conf.eth0.send_redirects=0
net.ipv4.conf.default.send_redirects=0
5)      优化TCP协议栈
打开TCP SYN cookie选项,有助于保护服务器免受SyncFlood攻击。
net.ipv4.tcp_syncookies=1
 
打开TIME-WAIT套接字重用功能,对于存在大量连接的Web服务器非常有效。
net.ipv4.tcp_tw_recyle=1
net.ipv4.tcp_tw_reuse=1
 
减少处于FIN-WAIT-2连接状态的时间,使系统可以处理更多的连接。
net.ipv4.tcp_fin_timeout=30
 
减少TCP KeepAlive连接侦测的时间,使系统可以处理更多的连接。
net.ipv4.tcp_keepalive_time=1800
 
增加TCP SYN队列长度,使系统可以处理更多的并发连接。
net.ipv4.tcp_max_syn_backlog=8192
阅读(1059) | 评论(0) | 转发(0) |
0

上一篇:内核参数

下一篇:mono install

给主人留下些什么吧!~~