① Modify the maximum number of files that can be opened by the server open files, because the Linux socket is also file, so this parameter has a direct impact on the number of network connections, the general machine is 1024, can be set to 65536
#vi/etc/security/limits.conf
The last two lines add the following
* Soft Nofile 65536
* Hard Nofile 65536
② Close the IPv6, so far we do not need to IPv6, the system after the installation is self-contained and open, we need to close.
See if there are any IPv6
#ifconfig #如果出现inet6 Addr ... The words, the description is installed
Or
#lsmod | grep IPv6 #会显示内核加载的ipv6相关模块
Disable www.111cn.net with the following command
#vi/etc/sysconfig/network
Modify
Networking_ipv6=yes
For
Networking_ipv6=no
And then close its module
#vi/etc/modprobe.d/dist.conf
Add the following two lines at the end of the file
Alias net-pf-10 off
Alias IPv6 off
Disable iptables for IPv6
#chkconfig Ip6tables off
Restart the machine to take effect after the modification is complete
③ TCP/IP network parameters tuning
#vi/etc/sysctl.conf
Add or modify the following configuration
net.ipv4.tcp_syncookies = 1 #表示开启SYN cookies, enabling cookies to be processed when SYN waits for queues overflow to prevent small SYN attacks
Net.ipv4.tcp_tw_reuse = 1 #表示开启重用. Allow time-wait sockets to be reconnected to a new TCP connection by default of 0, which means shutdown
net.ipv4.tcp_tw_recycle = 1 #表示开启TCP连接中TIME-wait sockets quick Recycle, default to 0, indicates shutdown
Net.ipv4.tcp_fin_timeout = #修改系? Default timeout time, in seconds, default to 240 seconds