Firstly, you should make sure to set up a proper cronjob:
https://www.greengeeks.com/tutorials/disable-cron-wordpress/
Secondly, have you tried using SSH commands such as TOP to check the running process information?
https://phoenixnap.com/kb/check-cpu-usage-load-linux
https://stackoverflow.com/questions/20693089/get-cpu-usage-via-ssh
In general, if you are renting a VPS, you need to troubleshoot this via the server, not WordPress, in order to verify the source of the CPU usage
Hi, I have disabled cron-jobs using (‘DISABLE_WP_CRON’, true); in configure.php
And also check ssh commands given below also I’m not renting VPS… but dosen;y work it’s still on hundred Is there still any way how to fix this?
top - 15:36:28 up 46 min, 1 user, load average: 16.75, 5.52, 2.97
Tasks: 121 total, 25 running, 95 sleeping, 0 stopped, 1 zombie
%Cpu(s): 85.2 us, 14.8 sy, 0.0 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 987.2 total, 48.0 free, 762.5 used, 176.7 buff/cache
MiB Swap: 953.7 total, 211.3 free, 742.4 used. 1.4 avail Mem
Based on that top output, the easiest way to fix your problem is to upgrade your VPS to one with at least 2GB memory. The top output shows that you’re using 1.5GB memory, half of which is disk-based (and extremely slow) swap memory.
I suspect you could also significantly reduce your memory needs by downgrading MariaDB or MySQL. MariaDB 10.3+ and MySQL 5.7+ are too large for a 1GB VPS — I’d use MariaDB 5.5, but MariaDB 10.1 will also work. Also be aware that your MariaDB/MySQL configuration must be fine-tuned to run well on a small VPS.
You should also be running PHP-FPM with the pm=ondemand setting, and PHP should be 7.4 with Zend OPcache enabled and configured for low-memory servers.
Hi, As you said I’m using 1.5gb memory but according to cloudflaare my ram is at 334mb but my cpu usage is 100%… And can I upgrade to php 7.4 as all of my plugins is not compatible with php 7.4 (I have check it using plugin) and all of my plugins are updated..
How would CloudFlare know what your RAM usage is?
Your CPU usage will remain at or near 100% until you stop using swap memory. It’s there for emergency needs, not for regular operation.
Your top output also states that you had 25 processes running, which is excessive for a 1GB VPS. I suspect it’s due to a poorly-configured Apache/PHP, and that could be determined by checking the remainder of the top output with the i command toggled to display only running processes.
If you are using PHP 7.3, then stick with it, and make sure to enable the Zend OPcache PHP extension and configure it for low-memory servers.
I had to write CLOUDWAYS the hosting provider…!
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
@husnain7umer I have archived your many multiple topics about the same thing. Also stop creating topics in Developing with WordPress. That’s the wrong place.
You are having a problem with your host. You need to contact your host provider and ask them for support. They should be the best people to help you.
@husnain7umer I have the exact same issue you have. Were you able to figure out whether the problem was with Cloudways hosting, WordPress code, or something else?
@jdembowski , it’s not that simple. Cloudways keeps referring us to cron code, heartbeat calls, etc. All of those are WP related.