

Using Amazon EC2 - amrithk

Hi everyone, 
We are currently using PHP as our server scripting language and MySQL as our database backend.<p>We have read about the benefits of Amazon Elastic Compute Cloud (EC2) service. I was wondering if anyone in this forum has used this service? What are your thoughts on switching from a shared hosting plan to this service? Any resources explaining how it all works (e.g: is there MySQL support, how do you communicate with one database if you are running many instances etc?)<p>Thanks
======
izak30
Ok, I was in your situation a month ago, and dove in. EC2 is great. It's easy
to setup.

I suggest starting with ubuntu, as there is a plethora of resources for it if
you are new to system administration

(start with this AMI
[http://developer.amazonwebservices.com/connect/entry.jspa?ex...](http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1425&categoryID=101)
)

Doesn't really matter if you are on osx, linux or windows once you are setup
really, but get elasticfox for firefox, it does all the trivial things
(starting an instance, etc) for you. very cool extension.

Just make sure you have a good backup plan for your data, as in any crash,
your data is lost.

It is much more like getting a dedicated virtual account at a regular
provider, so if you are used to control panels and everything like that,
you'll have to install them yourself. (webmin and usermin)

getting started with LAMP for ubuntu:
[http://www.ubuntugeek.com/ubuntu-710-gutsy-gibbon-lamp-
serve...](http://www.ubuntugeek.com/ubuntu-710-gutsy-gibbon-lamp-server-
setup.html)

------
streety
Although I use S3 I don't currently use EC2 and the limited research I've done
on it may mean that some of what I'm about to say is incorrect. Hopefully
others with more experience can jump in and correct any errors.

Firstly, when you talk about a shared hosting plan I assume you don't need to
set up the server, you just drop your files in the htdocs folder and your site
is ready to go. EC2 instances are analogous to a vps system. You're
responsible for setting up the operating system, installing apache, php and
mysql. There are 'images' (not sure that's the correct term) set up with
everything ready to go but that still leaves you responsible for a lot more of
your site than you may be currently.

My understanding is that MySQL is problematic. Currently each instance is
given a certain amount of hard drive space but if that instance crashes for
any reason all the data is lost. The intention is that S3 is used for your
permanent storage but it isn't suitable for running a database on. Permanent
drives have been announced but they will only be available later in the year.
Until then you are left with work-a-rounds, frequent backups to S3, mirroring
drives across instances in the hopes that you'll only ever lose one instance.

Connecting multiple web servers to a single backend database server is handled
in the same way it would be with any other vps service or indeed dedicated
servers.

~~~
cmer
The new persistent storage feature is game changing for MySQL. It is
definitely the missing piece to the puzzle. Backing up MySQL is just a matter
of calling 1 api command now. Plus, you'll be able to have pretty much
unlimited storage mounted to an instance.

~~~
amrithk
Any tutorials / services that show how one can get instance running up
quickly? I am a newbie to this.

~~~
cmer
RightScale.com is probably the easiest way to start.

Try one of their RightImages; we use their CentOS 5 32 and 64 bit images and
they're perfect.

There's also plenty of tutorials on Google on how to get started, but it'll
involve installing Amazon's command line tools, which is definitely more
complicated than point and click on RightScale.

------
rmason
If you're coming from Windows it's a pretty long learning curve. Seek out the
videos on the site, they're buried but worth searching out. Finding someone
with Linux experience to help you is recommended as well.

But AWS is pretty amazing and in my case it was worth the journey. Still
struggling with re-architecting apps into SOA but the scaling dividends should
be worthwhile.

~~~
amrithk
I develop in a Windows environment currently. I currently use S3 as a storage
solution so I am somewhat familiar with Amazon's web service offerings. EC2
seems really compelling but I am still not really sure how it all works (how
the MySQL database can be stored in S3, how databases can be replicated across
instances so that there is data consistency etc).

~~~
imp
MySQL will have to be run on the instance itself, not on S3. Just pretend it's
a normal computer, except that you have to have a plan for backups from the
very beginning. I recommend the book "High Performance MySQL" from O'Reilly.
It's helped me out a lot witih how to manage MySQL. Has chapters on
backups/replication/high availability.

------
delano
EC2 is like co-location in a cloud, so you will need to handle all sysadmin
tasks yourself (however, you can select an image that already has LAMP
installed). A single small EC2 instance is around $75 per month + bandwidth.

You can also go with a platform on top of EC2, like RightScale, which gives
you some support, including MySQL, but it's expensive ($500 per month!). I
don't have experience with other services but I do use the RightScale
dashboard for creating/restarting/terminating instances.

There are many advantages to going with EC2 though, if you can absorb the
admin work. For example, if you need to do some heavy crunching you can run
another instance only for the time of the crunching, say 12 hours, and that's
all you pay for (12 * $0.80, if you were to use an extra large instance).

------
metajack
We use EC2 for everything but monitoring, email, and DNS. The key factor for
us to switch from our more traditional hosting arrangements? The fact we could
deploy a new server in seconds instead of weeks. Amazon's non-premium support
via the forum is about the same speed as our previous hosting providers.

The only downside is that disk writes are much slower than on a normal
dedicated server. We had do spread out the application over more servers to
compensate for reduced CPU available as well. But even going from 4 servers to
25, we pay less than half what we used to.

I highly recommend EC2.

------
dmv
A nice thing is that it is elastic and cheap to answer your own question. It
is not like a shared hosting plan specifically in that there are no contract
terms or hassle to get started. Before you spend too much time, just fire up
an instance. If, between the docs and getting your hands dirty, it starts to
make sense - great. If not, you've "wasted" $0.10/hour (plus your own, more
valuable time) for a neat experience.

------
limeade
I've heard that there is too much latency to use EC2 as a host. Certainly
xforwarding is not great. Check out the creators of "Friends for Sale":
<http://omnisio.com/sdforum/siqi-chen>

------
fourlittlebees
There are several platforms already existing that can help you get up and
running faster: GigaSpaces and Appistry both come to mind, but they are geared
toward Java, .Net, and C++.

~~~
streety
To throw in one more environment you may want to take a look at flexiscale. It
may work out more expensive (largely because they're based in the UK) but they
have some nice features. Persistent storage, F5 load balancing (you don't need
additional instances to set them up as with EC2) and automatic restart if
something does go wrong with an instance.

Again, I haven't used them, just a bit of research.

------
wmf
I think going directly from shared hosting to EC2 is a bad idea unless you're
an experienced sysadmin. Try shared -> (managed) VPS -> dedicated server ->
EC2.

