0

My MySQL service started to using a lot of CPU recently. Few second after restart it takes 100% CPU's. I tried already changing my.cnf file to optimize cache/buffers. I have no idea what causing that high CPU usage. What can it be?

Here are my process list:

Id  User            Host        db              Command Time State                  Info                                                          
8           shop    localhost           shop    Sleep   64      NULL                                                                                      
10          shop    localhost           shop    Query   21  Copying to tmp table    SELECT default_products.*, default_brands.image as...                
11          shop    localhost           shop    Sleep   52      NULL                                                                                     
26          shop    localhost           shop    Sleep   142     NULL                                                                                    
45          shop    localhost           shop    Sleep   105     NULL                                                                                    
57          shop    localhost           shop    Sleep   75      NULL                                                                                     
58          shop    localhost           shop    Sleep   66      NULL                                                                                     
73          shop    localhost           shop    Sleep   18      NULL                                                                                     
77          shop    localhost           shop    Sleep   36      NULL                                                                                     
79          shop    localhost           shop    Sleep   31      NULL                                                                                     
84          shop    localhost           shop    Sleep   21      NULL                                                                                     
85          shop    localhost           shop    Sleep   74      NULL                                                                                     
86          shop    localhost           shop    Sleep   12      NULL                                                                                     
88          shop    localhost           shop    Query   11  Copying to tmp table    SELECT default_products.*, default_brands.image as...                
89          shop    localhost           shop    Sleep   72      NULL                                                                                     
90          shop    localhost           shop    Sleep   71      NULL                                                                                     
97          shop    localhost           shop    Sleep   67      NULL                                                                                     
98          shop    localhost           shop    Query   2   Copying to tmp table    SELECT default_products_sizes.*, default_sizes.siz...                 
99          shop    localhost           shop    Sleep   62      NULL                                                                                     
100         shop    localhost           shop    Sleep   46      NULL                                                                                    
101         shop    localhost           shop    Query   59  Copying to tmp table    SELECT default_products.*, default_brands.image as...               
102         shop    localhost           shop    Query   0   Copying to tmp table    SELECT default_products.*, default_brands.image as...                
106         shop    localhost           shop    Query   54  Copying to tmp table    SELECT default_products.*, default_brands.image as...               
107         shop    localhost           shop    Sleep   19      NULL                                                                                    
109         shop    localhost           shop    Sleep   48      NULL                                                                                    
111         shop    localhost           shop    Sleep   47      NULL                                                                                    
121         shop    localhost           shop    Query   3   Copying to tmp table    SELECT default_products_sizes.*, default_sizes.siz...                
137         shop    localhost   NULL    Query   0   NULL    SHOW PROCESSLIST                                                                             

And here my screen from htop as a proof:

http://i.stack.imgur.com/QsJ2a.png

migrated from stackoverflow.com Apr 17 '14 at 12:48

This question came from our site for professional and enthusiast programmers.

  • Do you often restart MySQL? Does the CPU usage stabilize after MySQL has "warmed up"? – Marcus Adams Apr 17 '14 at 12:40
  • I restarted MySQL few times recently, after changing settings in my.cnf. After restart CPU usage is normal, but when I visit webpage and queries start to execute it causing 100% CPU usage in less than a minute. – Wilhelm Trzęsiwłócznia Apr 17 '14 at 12:43
  • You can refer existing link which might be helpful to you stackoverflow.com/questions/8842260/… – Glenn McKay Apr 21 '14 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy