博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS6.8系统内核参数优化
阅读量:6163 次
发布时间:2019-06-21

本文共 2045 字,大约阅读时间需要 6 分钟。

系统内核如下:

centos6.8
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

服务器硬盘配置:

2颗CPU,单核12核心,开启超线程
cpu型号:Intel(R) Xeon(R) CPU E5-2690 v3 @ 2.60GHz (41500元一台机器)
共计48线程的逻辑cpu

内存是96G

php程序都是短链接

优化如下:

[root@localhost ~]# cat /etc/sysctl.conf

net.ipv4.ip_forward= 0

kernel.sysrq = 0

kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
vm.overcommit_memory = 1
net.ipv4.tcp_max_syn_backlog = 1638400
net.core.somaxconn = 1638400
net.core.netdev_max_backlog = 20000
net.ipv4.tcp_max_tw_buckets = 1800000
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 90
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_window_scaling = 1
net.ipv4.icmp_echo_ignore_all = 0
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.tcp_sack = 0
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_orphan_retries = 3
net.ipv4.tcp_reordering = 5
net.ipv4.tcp_retrans_collapse = 0
net.ipv4.tcp_wmem = 51200 131072 4194304
net.ipv4.tcp_rmem = 51200 131072 4194304
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1

net.netfilter.nf_conntrack_max = 655350

net.netfilter.nf_conntrack_tcp_timeout_established = 90
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 30
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 60

[root@localhost ~]#

优化后的并发可以单台服务器可以达到:61525
[root@localhost ~]# date
2017年 11月 29日 星期三 22:23:51 CST
[root@localhost ~]# ss -ant | awk 'NR>1 {++s[$1]} END {for(k in s) print k,s[k]}'
LAST-ACK 327
SYN-RECV 255
ESTAB 61525
FIN-WAIT-1 615
CLOSING 6
FIN-WAIT-2 15732
TIME-WAIT 12157
LISTEN 15
参考地址:
linux下修改内核参数进行Tcp性能调优 -- 高并发

转载于:https://blog.51cto.com/shuosir/2116412

你可能感兴趣的文章
C++解析XML--使用CMarkup类解析XML
查看>>
P2P应用层组播
查看>>
Sharepoint学习笔记—修改SharePoint的Timeouts (Execution Timeout)
查看>>
CSS引入的方式有哪些? link和@import的区别?
查看>>
Redis 介绍2——常见基本类型
查看>>
asp.net开发mysql注意事项
查看>>
(转)Cortex-M3 (NXP LPC1788)之EEPROM存储器
查看>>
ubuntu set defult jdk
查看>>
[译]ECMAScript.next:TC39 2012年9月会议总结
查看>>
【Xcode】编辑与调试
查看>>
用tar和split将文件分包压缩
查看>>
[BTS] Could not find stored procedure 'mp_sap_check_tid'
查看>>
PLSQL DBMS_DDL.ALTER_COMPILE
查看>>
Activity生命周期
查看>>
高仿UC浏览器弹出菜单效果
查看>>
Ubuntu忘记密码,进不了系统的解决方法
查看>>
[原创]白盒测试技术思维导图
查看>>
<<Information Store and Management>> 读书笔记 之八
查看>>
Windows 8 开发之设置合约
查看>>
闲说HeartBeat心跳包和TCP协议的KeepAlive机制
查看>>