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