Using Amazon EC2
Hi everyone,
We are currently using PHP as our server scripting language and MySQL as our database backend.
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?)
Thanks
(
16 comments
| 11 points
| on HN
)
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... )
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...
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.
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.
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.
Create Customized AMI: http://developer.amazonwebservices.com/connect/entry.jspa?ex...
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).
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.
Again, I haven't used them, just a bit of research.