I’m running on a lower end instance for development, so not outside traffic, but CPU spikes happen frequently when working with Wordpress. I have to stop and restart the Lightsail instance. Reboot doesn’t work. Aside from giving the system more resources, are there any tweaks I can do to mitigate these CPU spikes/lockups?
My servers stats are:
CPU: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, 1 cores
Real Memory: 420 MiB used / 218.08 MiB cached / 987.25 MiB total
Virtual Memory: 227 MiB used / 1023.99 MiB total
Local Disk Space: 11.15 GiB used / 27.98 GiB free / 39.14 GiB total
I’m new to Virtalmin so just kicking the tires myself. It depends on what you mean by development I guess but you could try turning off features you aren’t really using.
We’d need some clues about what’s using resources to try to help reduce them.
One obvious thing, though: You can’t host mail with that little memory. clamd would consume all your memory and most of your swap all by itself. You probably ought to be running a --minimal install for any system under about 1GB. But just turning off clamd gets you most of the way there.
Beyond that, you’ve got to show us something that indicates where resources are going. top and htop, for instance, can provide a close-to-realtime look at CPU and memory usage per-process.
Good advice. I am using -minimal and I disabled mail, dovecot, clamd, and several other services as per a Virtualmin recommended settings for smaller servers.
After more investigation it appears that it was overloaded with requests from bots or other nefarious sources. This domain name used to be hosted on Shopify, so it’s probably marked for death. A massive amount of them come and go at random causing the lockups by consuming memory/CPU. I don’t know if Virtualmin is what chokes here for the actual AWS instance. I’m leaving this here in case anyone else has a similar issue. I’ve since implemented a few firewall rules in Cloudflare to hopefully get rid of this, but as we all know, it’s an ongoing and uphill battle against the forces of evil.
If web traffic is triggering it, Virtualmin neither generates nor responds to web traffic to your WordPress site, so we can say with confidence Virtualmin has nothing to do with it. (Virtualmin is not the web server serving these requests.)