How do I fix the recent frequent high CPU alarms, even though there wasn't any changes to running applications, tech stack, etc.?
This is somewhat of a follow-up to a post I made three months ago: How do I fix the recent performance issues that seem to occur w/o any changes to resource consumption patterns, etc.?.
The good news is that I'm no longer experiencing any VPS freezing or performance degradation of the websites (WordPress sites).
However, I've recently noticed another issue. I've been getting high CPU usage alarms. There aren't any spikes in traffic, and I don't see any unusual activity on the websites. I see the same low-traffic patterns as usual. What's even stranger is that the alarms seem to occur during low-traffic windows, like at 5 pm or 2 am. I seem to get more traffic around 10a, where I usually don't get high CPU alarms.
It's strange that I get CPU alarms at these dead times but not at the more active times.
What's even stranger is that I got an alarm this morning and I SSHed into the VPS and ran
docker stats, etc. during a CPU spike and didn't notice anything unusual. No slowdowns with SSH (which I would expect to see), no slowdowns during page loads, etc.
I've tried experimenting with the PHP FPM settings and noticed little change, if any.
- I'm still using the Newark Datacenter
- The affected plan: Linode 2 GB
- My tech stack is Nginx, PHP FPM, MariaDB, and WordPress
Nothing has changed with my setup from 3 months ago, yet this started happening.
Tests using local VMs (via VirtualBox) with the same server configuration yield no spikes.
The only thing I can think of is due to these types of VPS plans to be on shared resources, I suspect it may be due to a spike in overall load on the underlying server. But I'm not sure how KVM manages shared CPU resources between VMs.
Maybe the Newark data center has too much load on it. Should I change datacenter?
Or maybe the CPU reporting is inaccurate?
I don't see any reason to up the plan since this has always worked and local VM tests show that my current plan is actually overkill.
Thanks, any suggestions to help me get to the root cause(s) are appreciated.
I'll keep trying some PHP FPM performance tuning and seeing the effects.
I may have found the right configuration.
Keeping fingers crossed.