Amazon EC2: Elastic Compute Cloud

Amazon’s Elastic Compute Cloud (EC2)
is an environment is your very own on-demand virtual Linux server farm.
Each EC2 virtual server can be configured just like a real Linux
server, you can communicate with it, you can install software on it,
you can configure it, you can even use virtual servers configured by
third parties.
The EC2 service allows you to resize your server pool (hence
‘elastic’) at a moments notice. If there is a demand spike, you simply
spawn more servers, if there is no more work to do, you make them all
vanish. As with Amazon’s other web services, you pay only for the
computing power you use. You can also scale the amount of processing
power available to you by using more or less powerful servers.
Your virtual server farm can be controlled by either an API, or by command line tools that Amazon provides.
Overview
There are 3 main components to the EC2 service:
- Instances. These are the virtual servers that run inside your farm, and perform the tasks that would otherwise be done by real servers.
- Environment. Instances run inside the EC2
environment. The environment provide configurable access control,
contextual data and other information that your instances need to do
their work. - Amazon Machine Images. AMIs are not dissimilar to Virtual PC or VMWare images. They represent a snapshot of your server, and serve as the boot disk.
Instances
Each EC2 instance is a Linux server to which you have root access.
The servers run inside a Xen virtual environment. Since the underlying
hardware is virtualised, its performance can be tuned within certain
preset parameters. Don’t let their virtuality fool you though, they are
configured to give you a very reasonable (and well defined) amount of
bang for your buck.
What do I mean by well defined? EC2 instances are rated by Amazon in
terms of the ‘EC2 Compute Unit’. 1 EC2 unit is approximately equal to
the ‘oomph’ provided by physical machine with a 1.0 to 1.2 GHz AMD Opteron processor, circa 2007.
Server instances can be spawned with one of 3 specifications. They
are classed as small, large or extra large. A small server boasts 1ECU
of power, with 1.7GB RAM
and 160GB of storage. An extra large instance boasts 8ECUs of power
(virtual quad core), with 15GB of RAM and around 1.7TB of storage. The
prices vary from 10¢ per hour for a small server to 80¢ per hour for an
extra large server. More details on the specifications of the machines
can be found on the EC2 home page .
AMIs
Every EC2 server instance is based on an AMI. This is a disk image
of the server’s root file system. When you launch, or spawn a new
server, it boots from the image with all of its installed software,
configuration and data that is stored in the AMI.
You can log into the instance with root priviledges and install and configure any software compatible with your instance’s Linux kernel.
Any changes you make to the system when it is live can be bundled back
into a new AMI that is the starting point for the next time your server
boots. If you so chose, you could create an AMI from scratch using a Linux distribution of your choice, Ubuntu for example.
The AMIs are stored in S3,
and they must be registered with EC2 before you can use them. You can
opt to keep the AMIs as private, so that only you can use them, or you
can share them. You can even create commercial AMIs and offer them to
other users on a paid basis. You simply register them with EC2 as a
paid image, then Amazon’s DevPay system will detect when it is run, and
bill its users a rate you define.
The EC2 Environment
The EC2 environment provides a set of services to your instance,
including networking, security, ephemeral storage etc. Access to the
instance is granted via key based SSH, so that only someone in
possession of the correct private key can access the system.
All internal and external IP Addresses were dynamic in EC2, there
existed no mechanism to hold on to a static IP, but it seems Amazon
have recently introduced good ol’ fashioned static IPs
. In addition,
any data written to the ephemeral storage is lost when the instance
dies, so, as is quite common with Amazon’s web services, it’s up to
you, the user, to implement any persistance strategy.
Spreading the love – here are a couple of projects built with EC2 in mind.
EC2 offers a big leg up to fledgling micro ISVs who lack the capital
to invest in serious computational power, but with EC2, it seems a
little more….civilised.
What say you?

Here is a tutorial to getting started with Amazon EC2 – http://www.searchblox.com/tutorial/sb_amazon_demo/sb_amazon_demo.htm