MySQL is using high CPU.

23 views
Skip to first unread message

Mrugesh Shah

unread,
Mar 3, 2016, 2:21:00 PM3/3/16
to vg...@googlegroups.com
Hello,

I have server configuration with 8 Core Processor with 32 GB Ram and It has just one high traffic site.

MySQL is using almost all processors and memory usage is approx 8 GB.

Due to high CPU usage site performance goes down.

I am attaching current my.cnf file to get the exact settings used in server.

Please do the needful.

--
Thanks & Regards,
Mrugesh C Shah
my.cnf

Ashish Srivastava

unread,
Mar 3, 2016, 2:42:45 PM3/3/16
to vg...@googlegroups.com, mruge...@gmail.com
Please enable slow query logs , check the queries and try to optimize that queries . 

--
Please read http://www.catb.org/~esr/faqs/smart-questions.html before posting.
You received this message because you are subscribed to the "Vibrant GNU/Linux User Group".
To stop receiving emails from this group, mail to VGLUG+un...@googlegroups.com
To post to this group, send email to VG...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/VGLUG

---
You received this message because you are subscribed to the Google Groups "VGLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vglug+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chintan Mehta

unread,
Mar 3, 2016, 10:28:13 PM3/3/16
to vg...@googlegroups.com
Try to explore.

Mysqltuner.pl
Mysqlprimer.sh

Google it up, it would help to suggest parameters based on usage and system configuration.

On top of it obviously timeout settings, slow queries, disk I/O to be checked.


Thanks,
Chintan Mehta

From: Mrugesh Shah
Sent: ‎04/‎03/‎2016 00:50
To: vg...@googlegroups.com
Subject: [VGLUG] MySQL is using high CPU.

--

Mayank Shah

unread,
Mar 3, 2016, 11:45:21 PM3/3/16
to vg...@googlegroups.com

When you see CPU utilization, where it is high. If it is more in wait stat, need to look at IO utilization side.

It may not be MySQL config issue. It could be File system structuring issue.

--

Sachin Watane

unread,
Mar 3, 2016, 11:45:21 PM3/3/16
to VGLUG
What is the version on your Mysql and is it install in linux or windows ?

Mrugesh Shah

unread,
Mar 4, 2016, 1:11:34 AM3/4/16
to vg...@googlegroups.com
Hello Mayank,

I have tune Mysql with mysqltuner and mysqlprimer. Both are in green mode.

Please check the below iostat output. Right now there is no traffic on server but still CPU usage is more than 50%.

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          13.89    0.01    0.68    0.25    0.00   85.18

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              22.64       757.38       489.24  371561828  240016784

Thanks,
Mrugesh

Mrugesh Shah

unread,
Mar 4, 2016, 1:11:34 AM3/4/16
to vg...@googlegroups.com
Hello Sachin,

MySQL version is 5.6.29 and It is installed in Centos 6.5

Thanks,
Mrugesh

On Fri, Mar 4, 2016 at 9:19 AM, Mayank Shah <maya...@gmail.com> wrote:

Sachin Watane

unread,
Mar 4, 2016, 1:35:07 AM3/4/16
to VGLUG
had u check the process list in mysql.

Sachin Watane

unread,
Mar 4, 2016, 1:35:07 AM3/4/16
to VGLUG
This will show you any queries that are currently running or in the queue to run, what the query is and what it's doing (this command will truncate the query if it's too long, you can use SHOW FULL PROCESSLIST to see the full query text).


On Friday, 4 March 2016 11:41:34 UTC+5:30, Mrugesh wrote:

Alok Thaker

unread,
Mar 4, 2016, 3:04:41 AM3/4/16
to VGLUG
Hi,

Why have you disabled query_cache_size = 0 ?

You have to put some good value in it so that it can perform well ?

Thanks & Regards,
Alok Thaker
Reply all
Reply to author
Forward
0 new messages