"Go" "RDS Tutorial" Professional DBA Express-CPU Optimization Chapter

Source: Internet
Author: User
Tags cpu usage

SOURCE:http://bbs.aliyun.com/read/160831.html?spm=5176.7189909.0.0.0thnem&displaymode=1&page=1& Toread=1#tpc

Presumably, everyone is very concerned about this problem? 6psk2d0
on the RDS instance CPU exceeds 100%, The occasional stuck phenomenon occurs. This is usually caused by SQL performance problems, which I'll analyze below.

principle:Excessive CPU consumption is usually caused by slow SQL, where the slow SQL includes a full table scan, scanning data volume is too large, memory sequencing, disk sequencing, lock contention wait;

Behavior :SQL Execution Status: sending data,copying to TMP table,copying to TMPtable on disk,sorting result,locked;
Workaround: The user can log on to RDS, view the currently executing SQL through show processlist, and when the show Processlist is finished, a large number of statements usually appear sending the state data,copy ing to TMP table,copying-tmp table on disk,sorting result, Using Filesort is a performance issue with SQL;
a.sending data indicates that SQL is querying from a table, and if the query condition does not have an appropriate index, it can result in a lengthy SQL execution time;
b.copying to TMP table on disk: This state typically occurs because the temporary result set is too large to exceed the temporary memory size specified by the database and requires a copy of the temporary result set to disk, which requires the user to /c5>
c.sorting result, Using filesort: This state indicates that SQL is performing a sort operation, the sort operation causes a lot of CPU consumption, and the usual optimization method will add the appropriate index to eliminate the sorting or reduce the ordered result set;
throughproblems and solutions for SQL statements found by show Processlist because of the length of the space, pleasetheReduce CPU Usage Case study

"Go" "RDS Tutorial" Professional DBA Express-CPU Optimization Chapter

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.