esoth.com gets an upgrade!

I am running this site on Amazon's ec2 service, which has been a fun little project in itself. The service is fantastic as it lets me do anything I need to on my virtual server, which in this case included installing Plone/Zope, Apache, a handful of C binaries I needed to get those working, and various eggs like PIL for my Zope buildout. In bygone days you'd maybe be allocated some physical space on a server that had PHP installed, but installing anything else was out of the question unless you paid significantly more to work on your own machine or something. I work with Plone and really wanted to run my own website with it where I could not only create content, but write code tailored to specific things I wanted to do (like the CD stuff and WoW armory data here). At one time I had made a site and served it from an old Dell running XP, but that's really stupid and awful! Elastic cloud computing to the rescue; and Amazon does it very well.

Anyway, I started this site running it on t1.micro, the smallest instance size Amazon offers. It was too small, really. Page serving would grind to a crawl or sometimes just flat out fail to load. I have some minimal caching set up, but this isn't a matter of inefficiency on page serving, this was something on the server taking way longer to do some task than it had any right too. I finally got around to running the Linux command top to see if some process was eating up all of the memory or something. The top process in that list was "python" (that's Zope/Plone in this case) but the mem usage was at 30%. That's high, but should be fine. But, it was also using 99.8% of the CPU. Whoops.

Amazon lists their instance types in terms of CPU, memory, etc., with the CPU being measured in EC2 compute units. It doesn't really say what micro offers in their list, just that it can spike up to 2 in short bursts. That's not really what I want for this site - Plone/Zope is going to use a decently high minimum threshold for running, and I'm not expecting to have short bursts of significantly higher computation power needed. I don't actually know how many units t1.micro runs on by default, but m1.small has 1 compute unit, so I'm guessing it's smaller than that (not to mention less memory). So I've decided to try out m1.small and see how that works out.

I was dreading this a little because it took some work to set up the environment when I originally put this site together, and while I can figure it out again, I don't really remember how I did it all! I remember having to install several things with yum that I couldn't believe didn't already exist, various means of troubleshooting at each step, etc. Doable, but some work. I started looking up how I should do this, figuring I would have to buy a new instance type, then move everything over, and try to make it all work again. I found a stack exchange post that talked about how to create a snapshot which I could use to load onto my new instance. That's not so bad, but I'd have to figure out how to do that still - the Amazon service seemed to offer a lot of types of data backup and whatnot. Then I realized you can just select the instance type (m1.small) you want from the EC2 control panel if you stop your instance first. Oh. So this daunting task turned out to be the following steps:

  1. stop the instance
  2. select the new instance type from a dropdown
  3. start the instance

Actually, it was slightly more than that. The upgraded instance gave it a new IP address so I did have to change that with my registrar service and wait for the DNS to upgrade. I also had to restart Apache, for which I have very little but needed configuration for this site, and I swear to god I always forget how to do this every time my instance restarts. The basic command I was expecting (a simple one line, pulled from a doc page that I had visited before) wasn't working. I started looking to see if I had another install of Apache somewhere else, or if I needed to update the config file, before making the smart choice of actually looking up the error message I was getting. Oh, I need to run it with sudo. >.<