WordPress on EC2 crashes and becomes inaccessible

298 Views Asked by At

I have a WordPress instance running on an EC2 (t2.micro). MySQL and WordPress are both hosted on this EC2 instance and an EBS is attached to it. The EC2 instance occasionally crashes and becomes inaccessible (accessing it on a browser times out) and sometimes I get the following error, which means the database is somehow not working:

Error establishing a database connection

If you look at the logs you can see that there are a number of peaks on EC2 "CPU Utilization" and also peaks on EBS "Read Bytes" at the same time. These are examples of occasions that it became inaccessible.

What can be the cause of this issue? Should I increase the memory of the EC2 instance or add more storage on EBS (it has 35G at the moment, I've already increased it)?

enter image description here

enter image description here

enter image description here

0

There are 0 best solutions below