Amazon EC2 Server CPU 100%

I signed up for the free year using the Amazon EC2 micro instance.  I was pretty excited to move off of my home server.  As mentioned in previous posts.  Unfortunately as mentioned by other posts, it doesn’t take much to bring down your system.  I currently have hosted a few WordPress blogs on this server and as soon as it is crawled by Google, Bing, or others it immediately goes up to 100 percent cpu usage and then is stuck there until I can manually reboot it.

Here are a few attempts at fixing the problem which I have done so far in order to prevent these spikes:

  • Added WC Super Cache.  The goal is to take weight off the database hits by providing a HTML cached version of the page.  When the website gets crawled it will be able to serve the pages quickly and also not max out the CPU usage.
  • Signed up for CloudFlare.  This does caching as well and blocks potential threats to your website.
  • Tune Apache.  Here are set of recommended choices from someone:

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 20
MaxRequestsPerChild 5000

  •  I am sure the list will go on and on.  I might try monit but haven’t yet.
  • UPDATE:  Another link for this situation.

Jumped in on Amazon EC2

I have obviously heard all the hype of the cloud infrastructures. Never had a need to jump in and try it though. I have been happy with my server machine that happily runs 24/7 using ubuntu. I have had it running over a full year without having to restart that machine even once. I made the mistake of looking at performance of the server. Not a good idea. I quickly realized that some of the websites I was hosting need to be on a more production like server. Now where do I turn? Maybe the cloud was my answer?

I really enjoy controlling the server so I immediately ruled out Google’s App cloud. It also ruled out the old $7 dollars/month domain hosting sites. Though some do allow ssh access they do not allow you to do upgrades on the server. I am down to only a few select. There may be others out there but it came down to Slicehost and Amazon EC2. Basically, since Amazon had the free year and I have heard so many good things about it. It ended up being a easy choice. The only probably is how much I will pay after the free year is up. I might end up going back to my old server if the cost is too high. Time will tell 🙂

I personally went with the Ubuntu Maverick x64 bit install. Here is the details – https://help.ubuntu.com/community/EC2StartersGuide

Here is some help for connecting with PuTTY for the first time:
http://docs.amazonwebservices.com/AmazonEC2/gsg/2007-01-19/putty.html