Re: High cpu usage

Machiel Richards <[email protected]> Fri, 26 Oct 2018 06:09:39 +0000
Newsgroups gmane.comp.db.mysql.general
Message-ID <DB7P192MB0268B520493943B04080F099CFF00@DB7P192MB0268.EURP192.PROD.OUTLOOK.COM>
--_000_DB7P192MB0268B520493943B04080F099CFF00DB7P192MB0268EURP_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi Shawn


   Thank you for the response.


    In order to pause the slave , the stop the sql_io_thread, and to unpaus=
e they simply start the thread.


     I have run "show engine innodb status" yes and the threads show 90% as=
 sleeping and then a few selects , all from the same table as it does a lot=
 of authentications for dial outs.


    I will have a look at the results from SELECT * FROM information_schema=
.INNODB_TRX; during the day as we get this issue regularly and will provide=
 feedback.



Regards


________________________________
From: shawn l.green <[email protected]>
Sent: Thursday, 25 October 2018 9:54:10 PM
To: [email protected]
Subject: Re: High cpu usage

Hello Machiel,

On 10/25/2018 6:09 AM, Machiel Richards wrote:
> Good day all
>
>
>     Hoping this mail finds you well.
>
>
>     I am hoping someone can perhaps give us some guidance here as we now =
seem to be stuck on a problem and have not been able to find a solution aft=
er more than a month.
>
>
>     We are running an opensips server on Centos 6.5 , using mysql 5.7.13 =
which was installed via Tarball file.
>
>
>     The server is setup as a slave and master and receives updates from o=
pensips config nodes as well as registrations from workers.
>
>
>     Replication is paused during the day and forward replication (master)=
 is disabled at the moment.
>
>
>     However , we are getting an issue every day on mysql side in terms of=
 mysql pushing up server load.
>
>
>
>      During the day the server is running fine with a load avg not going =
above 1.5 during peak times.
>
>
>      However in the evening , replication is unpaused, and completes proc=
essing and catchup within about 15 minutes and is paused again about 30 min=
utes after the unpause.
>
>
>
>        Give or take 45 minutes to an hour after the replication is paused=
 again, mysql starts to cause high cpu usage with no apparent processes run=
ning as can be seen on full processlist (maybe one or two selects which com=
pletes fairly quickly)
>
>
>         The higher load, causes queries to slow down however and opensips=
 to start timing out on db connections, causing clients to resubmit.
>
>
>       The resubmits , then obviously causes even more load spiking the my=
sql load to increase as well as the server load and eventually opensips kil=
ls itself.
>
>
>
>      I have looked at the disks, iowaits, memory usage, all is fine.
>
>
>      We do not see any strange queries or stick queries, no deadlocks, et=
c... only the increase in selects after mysql starts to push up the cpu loa=
d.
>
>
>
>      We have added all indexes we can find, but even this has made no dif=
ference at all.
>
>
>       Currently we are at a loss so I am hoping someone else can assist i=
n explaining how else we can find out why mysql is eating up the cpu ...
>
>
>
>     The same behaviour can also be seen the moment any new feature is add=
ed to the server that requires mysql processing to be done, so this does no=
t seem to be specifically related to replication, however it does seem like=
 the current load from replication causes mysql to act up.
>
>
>    the server is currently running on SSD (recently replaced) , and 8Gb o=
f memory with 1 x quadcore CPU.
>
>
>
>      should any more info be required, please feel free to ask.
>
>

When you say pause replication, what command are you executing on the
slave?

Which end of the system is experiencing the high CPU usage: the master
or the slave?

Have you checked these resources to see what the InnoDB main or
background threads are doing when your CPU starts to spike? (you could
be in a massive rollback)

SHOW ENGINE INNODB STATUS
SELECT * FROM information_schema.INNODB_TRX;

Yours,
--
Shawn Green
MySQL Senior Principal Technical Support Engineer
Oracle USA, Inc.

Become certified in MySQL! Visit https://www.mysql.com/certification/
for details.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql


--_000_DB7P192MB0268B520493943B04080F099CFF00DB7P192MB0268EURP_--