MySQL server process CPU Footprint 100% Solution

Source: Internet
Author: User
Tags mysql connect

Workaround One , modify the My.cnf file

Found it

Query_cache_size =0

Guess that's what this problem is causing, no query cache open

(General 1G on 64M cache)

My server's memory is 4G,

Adjusted to

The code is as follows Copy Code
Query_cache_size =256m

If your system needs a large temporary cache, we can find it again.

The code is as follows Copy Code

Tmp_table_size

Modify My.ini, Tmp_table_size assigned to 200M this size you can adjust.

Linux system consumes CPU 100% problem handling

Cause analysis

Deployment of applications every 30 seconds with master, a new connection to MySQL each time, after processing, then close the MySQL connection,
However, after the MySQL connection is closed, the TCP resource is not released and will remain in the TIME_WAIT state for 2-3 minutes.
In high IO operations, there is a stack of MYSQ requests, a new large number of MySQL connections, and then shut down, so there will be a very time_wait TCP connection.
Eventually led to a new MySQL connection, no TCP resources available, and finally MySQL connect fail

Possible solutions:

The

1.    changes how the connection is applied, changing to a MySQL long connection for each thread. (Short connection to long connection)
2.    changes the disk used in the MySQL database so that it is not deployed on the same physical machine as the application, or uses a stand-alone disk.
3.    Change MySQL configuration entry: Innodb_flush_log_at_trx_commit = 2

Related Article

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.