15 Feb, 2009
Posted by Bhavin Turakhia
Sandeep Shetty from our Products team introduced me to Scalr – an opensource self-scaling hosting platform based on the Amazon EC2 cloud. I decided to take a quick look under the hood and figure out how Amazon EC2 would function as a hosting platform. Here are my quick notes -
- EC2 offers the ability to instantly provision Virtual machines using an image (called AMIs) through an API
- Each instance is like a VPS with a certain amount of RAM, CPU, Disk capacity
- CPU capacity of an instance is measured in the form of EC2 Compute Units. From their FAQ – each EC2 Compute Unit provides the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor
- There are various types of instances
- As an eg, an instance with 4 EC2 Compute Units, 7.5 GB RAM and 850 GB storage would cost 40 cents per hour => ~$300 per month
- Data Transfer costs 10 cents per GB for outbound transfers and between 10-17 cents per GB for inbound. Assuming only outbound data transfer (typical case for a web app) and the lowest rate on EC2 (10 cents per GB) the cost per Mbps per month for EC2 works out to be approximately $32.
- For any persistent storage over and above that provided in the instance one can use Amazon Elastic Block Storage or Amazon S3.
- Amazon EBS costs are 10 cents per GB per month 10 cents per million I/O requests
- Many people tend to wrongly assume that EC2 (which stands for Elastic Compute Cloud) allows you to provision resources in an elastic manner and scale your application ad infinitum without any changes to the application. While in theory you can provision instances dynamically upon need, each EC2 instance acts like an independent machine with an independent OS, memory, CPU etc. It is identical therefore to provisioning multiple hardware boxes and any partitioning / load balancing etc would need to be done by the application developer at best online casino the App layer
- The elasticity does have considerable advantages in as much as provisioning is fully automated and each instance can be added / removed at a moment”s notice (about 10 minutes to boot up a new instance according to their FAQ) thus taking care of peaks dynamically
- Additionally no hardware setup is required to add / remove an instance
- Instances are provisioned through images which take care of complete setup thus relieving any system administration effort in setting up a machine
- Amazon EC2 provides the ability to place instances in multiple locations. Amazon offers multiple regions (USA / Europe) and various Availability Zones within these regions. Availability Zones are distinct locations that are engineered to be insulated from failures in other Availability Zones and provide inexpensive, low latency network connectivity to other Availability Zones in the same Region. Using instances in separate Availability Zones, one can protect applications from failure of a single location.
- Setting up an EC2 instance is quite easy. Once you create your AWS account, you can use the online AWS Console or simply download the offline command line tools to start provisioning your instances. Check the AWS Console Video for more details on the AWS Console.
- I can think of using EC2 instances for DNS infrastructure. Easy to deploy, and can scale dynamically to manage high loads. Additionally DNS servers do not require lots of storage and are innately redundant by virtue of the DNS protocol. Lastly, since EC2 provides multiple regions and zones, the DNS infrastructure can be scaled out resulting in geographical redundancy
- EC2 is great for prototyping as well as benchmarking
- One can also use EC2 deploying small web apps reducing time to market and allowing quick setup
- Many applications have monthly report generation requirements which too can be run of an EC2 instance. EC2 offers SQL Server instances incase you want a commercial database to run reports / crunch data.
- We have also been thinking of using EC2 for CodeChef. Since at CodeChef we plan on running a programming contest each mont, visitors as well as computing resources required to manage submissions increase considerably around the time each contest is announced. This makes Amazon EC2 a perfect candidate for dynamic resource deployment during contest-week
Other Amazon Web Services
- Amazon S3 provides a scalable, high-available and redundant NAS that can be used to store and retrieve any amount of data
- Amazon CloudFront is their CDN layered onm top of S3. It delivers content using a global network of edge locations. Requests for objects are automatically routed to the nearest edge location
// Begin Comments ?>