Mysql-show Processlist writing to net

Source: Internet
Author: User
Tags cpu usage

MySQL prompt writing to net resolution

A database has recently been found to have a CPU usage comparison. More than 200%.

First look at the database slow log, set slow log 5 seconds, basically no day, no more than 5 seconds statement.

Show Processlist;

After discovering a few select have several table query takes 1-2 seconds,

Explain select * from XXX, found no index, full table scan, the previous data amount of less that will soon come out, the current query total data are within 20,000, now the data is large, the other tables are 1000w level, previously only optimized the index of large tables, so the problem is highlighted. After the index was built, the CPU showed a drop, as far as I know, the MSYQL CPU occupies a high, 80% of the situation is not using the index.

At the second show Processlist

Multiple statement states are found to be writing to net

Through the analysis of the basic is a SELECT statement, are querying the data too database return network write-back does not win,

View Show global variables like "Global Max_allowed_packet" only 1 m

By increasing the cache

Set global Max_allowed_packet =134217728

Problem solved! The reason is that multiple select return data over the cache exceeds the default setting

Mysql-show Processlist writing to net

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.