1、php.ini 参数修改
mysql.max_persistent = 2048
mysql.max_links = 4096
2、my.cnf 参数修改
[mysqld]
max_connections=5000
3、httpd.conf 参数修改
MaxKeepAliveRequests 4096
<IfModule prefork.c>
StartServers 2048
MinSpareServers 2048
MaxSpareServers 4096
ServerLimit 20000
MaxClients 20000
MaxRequestsPerChild 32
</IfModule>
4、sysctl.conf 参数修改
net.nf_conntrack_max = 655360
net.core.somaxconn = 80000
net.core.netdev_max_backlog = 80000
net.netfilter.nf_conntrack_max = 655360
net.netfilter.nf_conntrack_generic_timeout = 1200
net.netfilter.nf_conntrack_expect_max = 5000
net.ipv4.neigh.default.gc_stale_time=120
net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2
net.ipv4.tcp_max_tw_buckets = 10000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 40000
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_max_orphans = 8192