I have a WordPress site with daily 25K visitor, +3K post and +22K comment. on a VPS with 2 CPU and 8 GB Ram with SSD disk, Centos installed. it was stable but from 20 days I found a very high CPU load and the website has become slow and many visitors got website down message.
When I am trying to troubleshot using "top", "glances" I found too many child process with "/usr/bin/php-cgi" and this process eating CPU and make server freeze and also I found "%us" very high and this is from "top": https://pastebin.com/wiYtcWAz
After search I found many tips speak about change to php-fpm instead of Apache and I did but this not help and the load covert from "/usr/bin/php-cgi" to "php-fpm: pool" and this is from "glances": https://pastebin.com/BYiSGjkY
So I decided to move on to a larger server for test and I put it on a dedicated server with 8 CPU cores and 32 GB Ram with NVME SSD disk and the problem has not been solved and the same load still there. After many searches I found many opinions speak about this is WordPress PHP files issues so I started working on it and I did the following as a attempts:
- Deactivate all plugins.
- Change the theme and used the default theme.
- Optimize the database and clean all unused metadata.
- Export and Import to new installed WordPress.
- delete all comments.
- delete all media files.
and the problem not solved. also I am take a look to cache so I use "wp-rocket" as a WordPress cache plugin with opcache php cache also I am tried "redis and memcached" and I still have the problem.