netstat -an | grep time_wait | WC
Log in to the Web server (Linux):
Netstat-ae |grep MySQL
By adjusting the kernel parameters to resolve,
vi /etc/sysctl. conf
Edit the file and add the following:
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
Then execute the /sbin/sysctl -p parameters to take effect.
net.ipv4.tcp_syncookies = 1 means that SYN Cookies are turned on. When there is a SYN wait queue overflow, cookies are enabled to protect against a small number of SYN attacks, the default is 0, which means close;
Net.ipv4.tcp_tw_reuse = 1 means turn on reuse. Allow time -wait sockets to be re-used for new TCP connections, which defaults to 0, which means close;
net.ipv4.tcp_tw_recycle = 1 means a fast recycle of time-wait sockets in the TCP connection is turned on, and the default is 0, which means shutdown.
net.ipv4.tcp_fin_timeout Modify the default timeout time for the system
After modification, use
[Email protected] mysql_log]# Netstat-ntu |grep TIME_WAIT|WC
0 0 0
Found a large number of time_wait no longer exist, MySQL process occupancy rate quickly down, the site access is normal!
Finally careful inspection found that the day before yesterday a new system, the program code is not used Mysql.colse (), resulting in a large number of MySQL time_wait
This article is from the "Broken Saber" blog, please be sure to keep this source http://90sec.blog.51cto.com/7404127/1703337
MySQL server discovers a number of time_wait solutions