Random CPU spikes caused by multiple .php-fpm.bin processes - Lightsail + WP

Keywords: WordPress - AWS - Technical issue - Other
bnsupport ID: 77e4fce8-414d-9dbb-7fac-bb9d1c4bbe46
Description:
I have an instance on Lightsail with Wordpress and this configuration: 4 GB RAM, 2 vCPU, 80 GB SSD.
The database is separate and has this configuration: 1 GB RAM, 1 vCPU, 40 GB SSD MySQL Database (8.0.21).

Randomly 1 or 2 times a week the instance has CPU over 100% with multiple .php-fpm.bin processes (pool WordPress) saturating it.

Here is the support bundle code: 77e4fce8-414d-9dbb-7fac-bb9d1c4bbe46

Thanks
Matteo

Hi @mapteo,

Thanks for using Bitnami. The WordPress pool of processes are the ones attending your website requests. According to the bnsupport bundle you shared there are two IP addresses making most of the requests on your server.

-----------------------------------
Check performance issues: Count number of requests for the 10 most active IP addresses in the last 100.000 requests
-----------------------------------
Running: tail -n 100000 access_log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10 | awk '{print $1}'
In: /opt/bitnami/apache2/logs/

Output:

45967
45668
8148
42
36
33
31
13
8
3

Can you check them in case they are bots?

https://docs.bitnami.com/bch/apps/wordpress/troubleshooting/deny-connections-bots-apache/

Hi @gongomgra thanks for your answer.

I’ve done a quick check by blocking these IP addresses.
If I block the first two addresses I get a 403 Forbidden error on the entire site. I think those IPs belong to the distribution nodes or the load balancer.

Hi @mapteo,

Thanks for letting us know. If you recognizes the IP address, then unblock them by removing the changes performed with the guide and restart Apache again.

I checked your bnsupport bundle again and I see you are running the MySQL server included on your server. If you are using an external database server, you can stop and disable the one included in your current server using the next commands.

sudo /opt/bitnami/ctlscript.sh stop mysql
sudo mv /opt/bitnami/mysql/scripts/ctl.sh /opt/bitnami/mysql/scripts/ctl.sh.disabled

This should help to your server performance by removing a process that is not necessary. Apart from that, I see you have many plugins installed that may be causing the CPU to get a high load.

Also notice Lightsail instances are usually burstable instances, in which you don’t get the same performance all the time. You can get more information about this at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html

Hi @gongomgra thanks for your support!
We will proceed with the in-depth analysis you suggested.

Hi @mapteo,

Thanks for your message. We hope you can get your issue solved.

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