HIGH CPU usage
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS |
New
|
Undecided
|
Unassigned |
Bug Description
Percona-
We find buf_get_
We'll make breif, and "https:/
case 1: If mysqld process is scheduled frequently, even though there is no activity, no read io, no dirty-page to flush, CPU usage reaches 100%.
We count times the process steps into the while-loop at buf0flu.cc:3208 and the else-branch(means there is no activity, the process idles) at buf0flu.cc:3375. And the statistic is as follows.
Almost all statistic is like
start_time= 1504143949175 end_time= 1504143949176 interval= 1ms loop_count= 7082 else_count= 7082
Only 1/20 or less statistic is like
start_time= 1504143949191 end_time= 1504143950191 interval= 1000ms loop_count= 1 else_count= 0
We see, everytime this process get scheduled, it idles mostly(in the case of there is no activity). We fix it by making this process sleep for a little while(0.01 second, by default) when there is no work, and CPU usage is decreased to 0-4%.
case 2: We use sysbench to test updating a varchar field, and CPU usage is about 130%-180%. buf_get_
44.06% mysqld [.] lock_rec_
12.69% [vdso] [.] 0x0000000000000600
8.17% mysqld [.] buf_get_
5.57% sap1006-64-v50107 [.] GoodMD5Transform
3.01% libpthread-2.17.so [.] pthread_
2.71% mysqld [.] ut_time_ms()
2.68% mysqld [.] buf_flush_
We find that buf_get_
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PS-3741