This web site, www.rajiv.com is now hosted on Amazon.com’s Elastic Compute Cloud (EC2) and Simple Storage Service (S3) services. They are part of Amazon Web Services offerings. If you are a technologist, I recommend EC2 and S3. To learn more about them, you can follow the links in this article.
Benefits of hosting a Web site on EC2 & S3
- The hosting management is self-service. Anytime you want, you can provision additional servers yourself and immediately. Unlike with most traditional hosting companies, there is not need to contact their staff and have to wait for them to set up your server. On EC2, once you have signed up for an account and set up one server, you can provision (or decommission) additional servers within minutes. Even the initial setup is self-service.
- EC2 enables you to increase or decrease capacity within minutes. You can commission one or hundreds of server instances simultaneously. Because this is all controlled with web service APIs, your application can automatically scale itself up and down depending on its needs. Billing is metered by an hour as the unit. This flexibility of EC2 can benefits many use cases:
- If your web sites get seasonal traffic (e.g. a fashion site during shows) or can temporarily get much higher traffic for a period of time (e.g. a news site), EC2’s business model of pay for what you use by the hour, is cost-effective and convenient.
- If yours is the R&D or Skunkworks group at a large or medium size organization or a startup company with limited financial resources, renting servers from EC2 can have many benefits. You don’t have to make a capital investment to get a server farm up and running, nor make long-term financial commitments to rent infrastructure. You can even turn off servers when not in use, greatly saving costs.
- You don’t pay a cent for servers not running, except for disk storage costs for your files on S3, which is so inexpensive that Jeremy Zawodny calculates is even cheaper than buying reliable storage for personal use at home.
- My favorite photo hosting web site, Smugmug’s CEO estimates how much money Smugmug saves about by using S3. The numbers are amazing.
- It allows me to use the modern Ubuntu1 GNU/Linux operating system, Server Edition. Among Ubuntu’s many benefits are its user friendliness and ease of use. Software installations and upgrades are a breeze. That means less time is required to maintain the system while retaining the flexibility and power being a systems administrator gives.
- EC2 has lower total cost ownership for me than most hosting providers’ virtual hosting or dedicated server plans. Shared (non virtual server) hosting is still cheaper, but no longer meets my sites’ requirements.2
Potential drawbacks/caution with EC2 & S3
- While S3 is persistent storage, EC2 virtual server instances’ storage does not persist across server shutdowns. So if your web site is running a database and storing files on an EC2 instance, you should implement scheduled, automated scripts that regularly back up your database and your files to S3 or other storage.
- Consistent with what I read in some comments online, my EC2 virtual server instance did not lose its file-system state or settings when I rebooted it. So rebooting seems to be safe.3
- This potential drawback is arguably a good thing in some ways. It compels you to implement a good backup and recovery system.
- This also means that after installing all the software on your running Amazon Machine Image (AMI), you should save it by creating a new AMI image of it as explained in the Creating an Image section of the EC2 Getting Started Guide.
- This is an issue since you may want to do this every time after you update your software, especially with security patches. Until Amazon implements persistent storage for EC2 instances, you could do this monthly. You can script this to be partly or fully automated. Since Amazon’s EC2 instances are quite reliable, this is not a major concern.
- An EC2 instance’s IP address and public DNS name persists only while that instance is running. This can be worked around as described under the tech specs section below.
Some articles about Amazon’s hosting infrastructure services:
- Wired.com: Amazon’s Hot New Item: Its Data Center
- Wired.com: New From Amazon: Guaranteed Server Uptime
Tech specs of my site:
- Hosting Environment & Configuration
- Amazon EC2 default “small” size instance
- Dynamic DNS Management:ZoneEdit.com
- I use a Ruby script to dynamically update DNS from my EC2 host on ZoneEdit. My script is based on the one written by Scott Patten. It uses the ez-ipupdate program in a custom way for EC2.
- LAMP Stack:
- Operating System: Ubuntu 7.10 Server Edition, GNU/Linux4
- Web Server: Apache 2
- Database: MySQL 5
- Programming Languages: PHP, Java, Python, Ruby
- PHP Accelerator: Alternative PHP Cache (APC)
- Instructions for installing APC on Ubuntu
- Content Management System: WordPress
- www.ubuntu.com [↩]
- I plan to split rajiv.com into separate sites, The India Comedy site will move to comedy.rajiv.com and the SPV Alumni site will move to spv.rajiv.com. The latter two are community sites and will benefit from a community CMS like Drupal. [↩]
- However, please be aware of a known issue that on some occasions caused instance termination on reboots. [↩]
- I created my AMI virtual machine by building on top of a public Ubuntu AMI by Eric Hammond. [↩]
Ryan Joy says:
Well, now I wish I weren’t locked into Dreamhost for another 2 years. This is the first post I’ve seen that made EC2/S3 look enticing from an individual’s point-of-view.
4 February 2008, 6:57 pmRajiv Pant says:
Amazon S3 had an outage in the morning of Friday, February 15th. You can read my opinion on the Amazon S3 outage and suggestions for dealing with outages.
17 February 2008, 11:42 amduanestorey says:
It’s a neat technical achievement, but I have to ask why you would do it with a personal site? You can get shared hosting for < $20 / month. So why would you pay a minimum of around $70?
7 March 2008, 6:56 amRajiv Pant says:
Duane,
Good question. I use my personal Web site as an R&D and learning environment. It enables me to experiment on a site that is real and has importance to me. Over the years, I’ve used a number of mainstream technologies including HTML/CGI, MS ASP, .NET, Java and PHP/WordPress to power this site. EC2 enables me to experiment with server virtualization and dynamic “elastic” hosting environments, an area of my interest.
For someone looking to simply host a personal Web site only, I agree with you and recommend lower-cost alternatives.
With EC2 and S3, Amazon has brought some of the power of a distributed edge computing platforms like Akamai’s Edge Computing and NetStorage to the mainstream, including startup ventures (whether independent or within large organizations), small businesses and organizations with budget constraints. It will be exciting to see if Akamai responds by offering their edge computing platform to the masses. I hope they do, because I’ve been impressed by Akamai’s products for years. Akamai has enabled many major media companies to handle traffic spikes without having to build out multiple geographically distributed data centers of their own. I hope Akamai views EC2 and S3 as competitors in distributed elastic computing. That will be good for Amazon AWS, for Akamai and for businesses that benefit from such products.
16 March 2008, 12:28 pm