Author Topic: mysql get 300% cpu  (Read 2335 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
mysql get 300% cpu
« on: May 01, 2024, 07:02:52 AM »
Ηello.  Please help. Why does mysql get 300% cpu usage?

This is what I get in my email.
Excessive resource usage: rpc (620 (Parent PID:620)

Time:         Wed May  1 09:58:08 2024 +0300
Account:      rpc
Resource:     Process Time
Exceeded:     30668 > 1800 (seconds)
Executable:   /usr/bin/rpcbind
Command Line: /usr/bin/rpcbind -w -f
PID:          620 (Parent PID:620)
Killed:       No


« Last Edit: May 01, 2024, 07:13:06 AM by dimitris_p »

Offline
*****
Re: mysql get 300% cpu
« Reply #1 on: May 02, 2024, 01:47:29 AM »
How many cores? Dedicated or VPS? What is your typical load and how many user accounts do you have? Have you done any MySQL tuning? The CWP dashboard is notoriously unreliable. Have you watched htop or Netdata on your server for awhile?

Offline
*
Re: mysql get 300% cpu
« Reply #2 on: May 02, 2024, 10:26:12 AM »
It is a vps server from contabo. 4 cores and 8gb ram. On htop it shows the same. I have only one user. It shows when a forum loads. When I restart the server or in mysql it is fixed

Offline
*****
Re: mysql get 300% cpu
« Reply #3 on: May 02, 2024, 09:22:52 PM »
Does your forum software recommend any MySQL tuning options? I know various CMS platforms have specific recommendations (e.g. Drupal needs a much larger max_allowed_packet). Have you looked at general purpose MySQL tuning scripts?
Code: [Select]
https://github.com/major/MySQLTuner-perl

Offline
*
Re: mysql get 300% cpu
« Reply #4 on: May 03, 2024, 07:04:34 AM »
The software is invision board, I don't know about max_allowed_packet. Can I increase it for testing? Do I change this from php?

Offline
*****
Re: mysql get 300% cpu
« Reply #5 on: May 03, 2024, 07:27:30 PM »
You have to edit your / etc / mysql.conf with your performance tuning options. I would definitely recommend the perl tuning script -- it gives very good suggestions as to what the tuned options should be on your system.

Offline
*****
Re: mysql get 300% cpu
« Reply #6 on: May 03, 2024, 10:30:54 PM »
@overseer, is this the one you use?

https://github.com/major/MySQLTuner-perl

Offline
*****
Re: mysql get 300% cpu
« Reply #7 on: May 04, 2024, 02:05:33 AM »
Of course, I meant / etc / my.cnf -- I was on the run for that last message.

I'm a belt & suspenders kind of person, so I use both:
https://launchpad.net/mysql-tuning-primer (shell)
https://github.com/major/MySQLTuner-perl (perl)

There's also phpMyAdmin > Status > Advisor for some recommendations.
If you want the full Swiss Army knife, get mysqlreport:
http://hackmysql.com/mysqlreport
and mytop:
http://jeremy.zawodny.com/mysql/mytop/

As for Invision Power Board, this seemed salient:
https://dba.stackexchange.com/questions/91428/invision-power-board-3-4-6-mysql-locks-during-query-with-pending-updates
Check the accepted answer -- make sure you are ussing InnoDB and not MyISAM for the table engine. Also note that it may be counter-intuitive, but having too large a tmp table size may reduce performance.

Also, why does your server not have swap? Seems odd to me...
« Last Edit: May 04, 2024, 02:15:54 AM by overseer »

Offline
*****
Re: mysql get 300% cpu
« Reply #8 on: May 04, 2024, 07:05:49 AM »
Just saw that.

Yea, the SWAP should be between 8-16GB is there is 8GB System RAM.

If you have the space, you defiantly want to configure that.
Let me know, I can post the step-by-step commands.