I manage a website that is essentially just a news/blog powered by WordPress. Average users on the site is somewhere between 8-15. But we occasionally break news in our niche where we'll have anywhere from 1.5-5,000 people on. Up until today we were hosting the website on a VPS through Dreamhost. We moved to AWS/EC2 because I thought the scalability would be nice to have.
I backed up our entire server, started an EC2 instance (t2.micro running WordPress for AWS by Bitnami), created a storage drive for it, gave it an elastic IP, migrated and restored all our data (using UpdraftPlus). I was then happy the server was acting reasonable, took down our previous server, and created a DNS Record pointing to the IP for the AWS instance.
However, today we ran into an issue where the CPU was pegged at 100% utilization, with CPU Credits still available. I thought available CPU credits would scale the server so that it wasn't pegged at 100% usage. I guess I misunderstood. So I thought I needed to setup an auto-scaling group. So I created an AMI from the instance I already had setup, created a launch config, and created a load balancer. I then set the auto-scaling group to have 1 Desired, 1 Minimum, and 5 Maximum instances, to launch an instance if CPU => 85%, and to close one if CPU =< 35%.
I thought that would have been good, but I ran into an issue where once I set that up. It terminated the instance I setup earlier and took my entire website down. I then ran around in a panic until I realized it didn't delete the storage, and I launched another one and attached that drive.
Am I missing something here? How can I setup AWS/EC2 to handle a couple thousand users using the exact same data/website, and always have it up, not have it terminate my original instance?
Any help would be greatly appreciated.