Amazon EC2: Instances, IPs and a wordpress blog (LAMP)
        Posted  
        
            by 
                JustinXXVII
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by JustinXXVII
        
        
        
        Published on 2012-09-04T20:47:20Z
        Indexed on 
            2012/09/04
            21:40 UTC
        
        
        Read the original article
        Hit count: 315
        
I had a link to my blog posted on Reddit yesterday and MySQL crashed on my EC2 Micro instance. I know I didn't have that many visitors because I used a marketing link that tracks hits. The link got 167 hits over the course of the last 18 hours, and MySQL crashed twice.
So anyway, 167 visits is not a lot, so I've done some short term optimizations like restricting the number of Apache threads to limit the MySQL calls. I also set up WP Super Cache to serve static content. Soon I'm going to offload all of my images to S3 or CloudFront. So this leads me to my question.
If this doesn't seem to help, and if i have another traffic "spike", how do AMIs work when you have a MySQL database? I think I understand that if you have more than one instance and assign the same Elastic IP to both of them, the incoming traffic gets distributed among both. But what happens when the MySQL database gets updated on one of the instances?
I just need to wrap my mind around what happens when I create an AMI and then launch a new instance to help with traffic.
Thanks for your suggestions.
© Server Fault or respective owner