2

I'm currently working on a wordpress website on AWS lightsail. Its very basic and I have just installed the oxygen theme to edit the site.

I am in one country and my friend (who I am doing this for) is in another country.

He logged into the site the same time I was editing it, and it caused this spike in the CPU usage:

enter image description here

This made the website not load in the browser and I could not even SSH using the web based SSH terminal.

That isn't a very big spike and I'm worried I set something up wrong. Is there anyway to see more information on this metric? or see more metrics as to why my instance went down?

1 Answer 1

7

Not related to cpu, but I had similar issues with Lightsail servers randomly becoming unresponsive. Try checking your swap space. There probably isn't any configured if you used the amazon images, and couldn't hurt to add some.

I used this set of commands here:

# first check if any
swapon -s

# then add some if not
sudo fallocate -l 1G /swapfile 
sudo chmod 600 /swapfile 
sudo mkswap /swapfile 
sudo swapon /swapfile 
sudo cp /etc/fstab /etc/fstab.bak 
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Tweak the size if

2
  • 1
    Buddy, this was exactly what my issue was. I would have never thought to check this! Usually default installs have plenty of swap space but these aws instances didn't have any. Swap: 0 0 0. Why on earth do they do this?? Swap space is basic linux 101 and one of the first things that is taught to those seeking linux certifications. I have been reconfiguring my php.ini, php-fpm and httpd.conf files trying to troubleshoot why my server goes unresponsive and here it is. Swap space. Thank you so much.
    – waltmagic
    Dec 1, 2022 at 9:11
  • This answer is still here helping frustrated developers! Thanks! (And why on EARTH doesn't AWS default the swapfile to at least a couple GB??) 4 hours ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.