HIGH CPU Usage webmin and wordpress in a VPS

Hi all,

in a VPS OVH with 4 CPU and 8Gb RAM, i’m running a one Wordpress Website
However, i noticed high usage of CPU

how can i check why CU is high used ?
how to reduce this?
is there a way to specify the max load of cpu ?

thanks to check screens for more info :

Thank you

SYSTEM INFORMATION
OS type and version ALMALINUX
Webmin version 2.101
Virtualmin version 7.8.2
Related packages Wordpress

There are a few topics on here about high CPU have you read the.

As before, I think you will find this is down to a WP plugin (badly coded) or requiring an update. have you checked that MariaDB is still running and any php logs for problems?

4 CPU is certainly good enough. I would say 8Gb is a little on the light side. But I assume memory is not the problem. Check the logs as always. the CPU will always go up intermittently for example when to view stats in the Dashboard but will drop back very quickly.

Thank you for your reply,

yes i checked topics about CPU Usage but didn’t find an answer to my issue.

My WP is up to date also all plugins ( i use only 7 plugins cause i don’t want to supercharge website)

i checked error pages and see those lines :

#5 {main}
thrown in /home/happyhand/public_html/wp-content/plugins/really-simple-ssl/lets-encrypt/class-letsencrypt-handler.php on line 1715
[19-Nov-2023 17:30:08 UTC] PHP Warning: Undefined array key “returnvalue” in /home/happyhand/public_html/wp-content/plugins/wp-rocket/inc/Engine/Optimization/RUCSS/Frontend/APIClient.php on line 101
[19-Nov-2023 17:30:09 UTC] PHP Warning: Undefined array key “returnvalue” in /home/happyhand/public_html/wp-content/plugins/wp-rocket/inc/Engine/Optimization/RUCSS/Frontend/APIClient.php on line 101

But the big question is :
Why CPU usage for webmin theme and stats is 47 % and 28 %

how to reduce it ?

regrads

If you disable/remove those plugins really-simple-ssl and wp-rocket does that drop the CPU use.

There is clearly an error in wp-rocket looking for a non-existent key.

which php version are you using? Are you using FPM? Which modules are installed? All given under Virtualmin -> Server Configuration -> PHP Options

It should be only transient (even ith a single core) there is quite a lot of work to do. but I would go into theme settings and at least reduce it to 24hrly (I think that is default) there are other settings that may help. 47% transient when viewing Dashboard doesn’t seem that bad mine spikes > 80% (2 core)

Exactly the important number here is load averages over time for instance from one minute to another its just under 15% not terrible. Both at 1 and 5 minutes.

Spikes mean that your processor is being allocated properly when something is being demanded from webmin it should have priority in theory you want to be able to get on your server and get information have priority and fix things at god speed more or less what you are seeing I feel is not atypical from a load averages perspective. Transients when using the interface for data gathering are intensive to get you your information from multiple sources and do it quickly many operations are taking place there behind the scenes you may have 300+ processes running and lord knows how many are being executed to grab your data and give it to you nearly in real time in readable format. Its gotta collect all of this data from multiple sources and processes and parse all of that feedback and give it to you in readable format and do it quickly. Any software that does this is intensive even if your not running a server and you run similar software on a desktop you’ll experience the same jump in CPU use.

1 Like

tried desactivation of both really ssl and wp rocket but still have same cpu usage

i use php 8, FPM is running and here are php modules activated

screen : PHP-Version hosted at ImgBB — ImgBB

That is quite a few more than the standard Virtualmin install. I’m not sure what those extra ones are doing. Perl is installed anyway - those extra ones look to me like 3rd party modules. I wonder where they have come from and why they are there.

someone more up to date on PHP could chime in here?

euh, do i nead to desinstall pcre ?

also i notice that PHP version in the picture is 8.1.2
but when i checked the php file info i find 8.0.30

i changed webmin theme from authentic theme to classic ; i noticed that less process are running and cpu usage is lower.

may be also because i desactivated ssl plugin and wp rocket.

anyway, wanna check in different hours a day and come back with news?

thank you very much for your time

No! What are you talking about?

Don’t go randomly uninstalling packages. You don’t even know you have a problem yet.

A momentary spike to 99% is not unusual.

Does it stay at 99% all the time, or does it drop down to something more reasonable most of the time?

In the process list you show, I don’t see anything particularly scary in terms of CPU usage.

You sure you not getting a DOS attack, those % look high and alot of them, mine are like 1-3%.
I have about 12 WP hosted on 4GiG real ram

Maybe sigh-up to cloudflare as they can help with load and dos attacks.

1 Like

Oh, actually, you’re right, OP does have quite high load. I glanced and just thought “OK, he caught it at a bad time”, but 15 minute load average is 14, which is a lot.

So, OP, almost all of your CPU is going to php-fpm, so the app in happyhand is working hard. Figure out what app or plugin is doing it, and disable it and find an alternative, or fix your database queries if it’s your own code. (Turn on slow query logging in your database, perhaps, to help troubleshoot.)

I’d also check how many connections you have to your web server:

netstat -ant | grep -E ':80|:443' | wc -l

To continually watch, updates every second
watch -n 1 “netstat -ant | grep -E ‘:80|:443’ | wc -l”

1 Like

#watch -n 1 “netstat -ant | grep -E ‘:80|:443’ | wc -l”

wc: invalid option – ’
Try ‘wc --help’ for more information.
-bash: :443’: command not found

You copy/pasted nonsense.

@stefan1959 did not wrap code in a code block. Use triple backticks to open and close a code block or a single backtick to open and close code within regular text…e.g. netstat -ant | grep -E ':80|:443' | wc -l or:

netstat -ant | grep -E ':80|:443' | wc -l

Not wrapping code in backticks leads to the editor replacing quote symbols with “smart” quotes, which are nonsense to your shell.

1 Like

Deleted as I worked it out. :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.