Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough

AWS “Micro” Instances or How Web Sites are like Mini-Marts

Parent Feed: 

I’ve been tossing about the idea of moving some of the sites I host to Amazon Web Services, specifically EC2 (server), S3 and EBS (storage) and CloudFront (content delivery network).  Price was my excuse for not jumping (OK, the real reason is the inevitable pain that comes with moving hosting providers) but with today’s introduction of “Micro” instances, I no longer have that excuse.

AWS now can host my sites for roughly the same price I pay for shared hosting!

(24 hours * 365 days) / 12 months = 730 hours/month
EC2 Micro pricing: $.02/hour = $14.60/month
EC2 Micro 1-year reserved instance pricing: $.007/hour (plus $54/year) = $9.61/month
EC2 Micro 3-year reserved instance pricing: $.007/hour (plus $82/3-years) = $7.39/month

These prices are starting to overlap the range of shared hosting prices.

What’s so great about AWS, especially as it relates to Drupal?  A few things to consider:

  1. You have access to Amazon’s pipe. This is the same connection to the Internet backbone they use for Amazon.com.  Sure, you could pick a shared hosting provider that’s well located and (according to their splashy promos) have high-throughput connections.
  2. Amazon’s services integrate well with each other.  Sure, you could sign up for a third-party CDN and, yes, some hosting providers offer daily backup.
  3. Database is on localhost – great for DB-intensive apps such as Drupal.  Sure, some shared hosting providers do that but most don’t put such geeky details on their splashy promo page.  A call to tech support will suss that out – in fact, if tech support knows what you’re talking about that bodes well for that provider.
  4. Lots of memory for PHP.  Sure, shared hosting, um...  never mind.

AWS hosting is unmanged hosting – meaning there’s no hosting provider artificially capping your CPU usage, PHP memory or bandwidth.  Plus you’ve got full root access meaning you and fiddle with more config files than you knew existed.  “Great,” you may exclaim, now I can tweak Apache/MySQL/PHP to my heart’s desire to squeeze every last optimized bit out of my server.  Yes, I can!

Yes, I can also take down my site (and that of my clients) because my LAMP know-how is just enough to get my in trouble.  Damn double-edged swords.

But I’ve been bumping up against limitations with shared hosting more and more frequently.  In other words:

if (shared_hosting.pain() > (server_migration.pain() + sys_admin.pain())) {
  AWS = new HostingProvider();
}

How AWS works

Pretend you run a 24-hour mini-mart. You’re open all the time so you have to have someone behind the counter at 3am when a random drunk needs a munchie fix.  You add more staff during the off-to-work rush (coffee, donuts and newspapers) and the afternoon rush (six-packs and heat-and-eat dinners) and scale back staff when it’s less crowded.  But all this time you pray you don’t get caught understaffed by some odd rush at 10pm on a Thursday night because you make your money by selling stuff to people as fast as they come in the door.

A site such as this, which got about 2000 page-hits last month (despite the fact I haven’t posted since May...  um, sorry about that...) spends a great deal of time twiddling fingers waiting for page requests.  But if this article gets linked to by the likes of Slash-Dot or Digg, the one high-school stoner manning the checkout counter ain’t going to meet the needs of all those visitors.

Like the mini-mart, you want to add resources during busy times.  With AWS, you can do this automatically – swap the stoner for a half dozen smiling, uniformed (sober) staff when 20 people walk in the door.  Swap them out when they leave.

All this mini-mart talk is making me hungry.  Maybe I’ll start moving servers after lunch...

Author: 
Original Post: 

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web