Solutions to mysql connection overhead and death and DoS

Source: Internet
Author: User
Solutions to mysql connection overhead and death and DoS

Solutions to mysql connection overhead and death and DoS

Too many mysql connections will always die, and then I found this article from Mysql 5. after a version of x, the feature of Mysql to automatically disable idle connections has been modified. If a connection is idle to the timeout time (the default value is 28000 seconds and 8 hours ), re-initiated Reconnect reconnection requests will not be accepted, and new connections need to be re-established, which causes the re-Connection Mechanism of SER to fail: the SER will only use the same connection interface when it needs to operate the database. If it is disconnected, it will initiate a reconnection request, and this problem cannot be solved within a short period of time. :) solution: 1. if Mysql 4.0 or 4.1 is used, some new features such as stored procedure triggers of Mysql 5 are not used. 2. regularly restart the Mysql server or Ser (because this problem may also affect other server programs that require Mysql support, it is better to restart the Mysql server, however, it is difficult to determine the time when the Mysql server is not used to restart.) 3. set my. cnf, with the parameter added in the mysqld field: [mysqld] port = 3306 socket =/tmp/mysql. sockwait_timeout = 500000interactive_timeout = 500000 (timeout of about five or six days in 500000 seconds, you can select a time value that may be idle for a database as needed .) Restart the Mysqld application. You can also add the-o wait_timeout = 500000 parameter when executing mysqld. When you show variable on the mysql client, you can see that the last line is changed from the default wait_time = 28000 to 500000. (You may need to restart the host if Mysqld does not take effect :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.