I am trying to consider where to host my website and I am really sold on Amazon web services but I can't really decide if this is the course I want to take because of pricing. For one thing, I am not sure what setting to place into the cost calculator to get a good estimate.

I will be needing an EC2 instance since I will be running Apache server and as well I will be running a Java application which will be hosting a web-service which will interact with the MySQL database. (Which I am not sure if I should use Amazon RDS for)

If I had to make a very rough estimate (an optimistic absolute upper bound), I would say that I need to support 5 web requests per sec and around the same amount of requests on the MySQL. Maybe, 50gb of bandwidth out to users.

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

I know very little about Amazon's PaaS offerings, but I know that $200/month is expensive; and I doubt you're going to need 160Gb of local storage..
– Mark Henderson♦Feb 12 '12 at 19:32

1

There's been plenty of talk about this on the blogosphere in the last week.
– EEAAFeb 12 '12 at 20:12

1

For such a small amount of traffic, you may find that a cheap VPS like Linode or Rackspace can give you what you want cheaper (and faster than the EC2 Micro instances).
– Brendan LongFeb 13 '12 at 2:10

2 Answers
2

As you note, there are a number of costs associated with EC2, beyond the cost of running the instance, however, the 'instance-storage' mentioned in your question is not one of these.

Each EC2 instance (except the t1.micros) comes with ephemeral storage, that is included at no extra cost (neither for I/O nor storage). However, this storage does not persist - as soon as the instance is stopped or terminated, the contents of the ephemeral storage is erased. It is only useful for transient purposes (e.g. temporary files, some types of caches, intermediate files in build processes, etc)

You will, therefore, require an EBS volume to store your files - both for core software and your web application. I usually favour using at least 2 EBS volumes - one for the root volume, which I expect minimal changes to, and one for everything else (databases, logs, mail, application + user data, etc).

EBS Storage

I can't judge your storage needs, but software (operating system + LAMP stack + mail, etc) will likely be under 2GB. I presume your application is fairly small - which means that the unknown is user data (databases, files, etc) - I'd say 10GB is likely enough to start with in most cases.

I'd estimate around the same used space as your total data stored (the data is compressed and each snapshot is differential, but they do add up over time), so presuming you start with only 8GB of data + 2 GB on your root drive = 10GB (obviously, swap wouldn't be snapshotted);

Depending on the choices you make, your costs come out to somewhere between $20/mo (3 year reserved t1.micro) and $80/mo (on-demand m1.small).

Notes:

5 requests per second is a fairly small amount - even a t1.micro should be able to handle that. I would suggest trying your application on that instance type first (AWS does offer new customers one year of free t1.micro usage) - if you need a larger instance type, it is a simple matter of stopping (not terminating) your instance, and modifying the instance attributes, you can be back online in under 5 minutes running your new instance.

I am not a Java person - but if you can use a lightweight web server (nginx, lighttpd) instead of Apache you will get much better performance out of an EC2 instance (the primary problem with Apache is its memory usage, especially on a t1.micro).

If you use the t1.micro, I would advise against using a 64-bit operating system, it has a limited amount of memory, and the 64 bit registers considerably increase the needed memory with no tangible gain.

Also, I if you do not have a particular preference for an operating system, I'd suggest Amazon's Linux AMI - it is based on RHEL/CentOS with all the unnecessary parts removed, and is officially supported (and they keep their repositories up to date!).

Don't bother with Amazon RDS - most people find its performance to not be that great, and it doesn't offer much by way of 'automatic' functionality (e.g. you still have to manually setup replication, etc, and the normal limitations apply).

A word of caution regarding the t1.micros - their performance is highly variable - if you can keep your CPU usage low, you will be fine, but if you find it spiking, the performance will be awful. The other instances have much more stable performance.

Finally, while you want a good idea of how much it will cost, don't over-estimate. It is easy to speculate that you will need a mammoth of a server to run your application, but if you find it coming to that, you can always find a different provider later on, or shift to a different instance type. With the cloud model, you don't need to factor in future scale as much, because it is fairly easy to scale.

You can try the AWS Cost Calculator to play with the numbers (although, personally, I prefer doing it by hand).

What do you mean you have to set up replication on RDS? I'm fairly sure that's not true... That said, the rest is good.
– ceejayozFeb 13 '12 at 1:47

@ceejayoz: What I meant is that RDS is not a 'magical' auto-scaling solution. It won't just keep adding capacity as you need it and transparently handle replication in the background. You have to explicitly setup Read Replicas, and you don't really get 'multi-master' failover (the Multi-AZ deployments help, for sure, but it is not a full solution). Beyond that, if you get into replication, you are paying for each instance anyway, it is not capacity based (now DynamoDB should be more of an 'elastic' solution, but it is NoSQL). My position being that there is little gain from RDS for most cases.
– cyberx86Feb 13 '12 at 2:14

In my experience a micro instance cannot handle more than a continuous 1 req/s, whether it be Ruby or PHP. The only way you'll be able to serve 5 req/s is if the requests are for static files.
– skrewlerMar 27 '12 at 23:21

You should be able to easily support 5 Apache requests/second off the $15/month micro instances. A small instance will run you $60/month or so, and as with the micro instance should run MySQL + Apache just fine, so I'm not sure where the $200 comes from.

Things also become drastically cheaper - as much as half off - if you can commit to a one or three year period for that instance type.

As I said above, 5 req/s is certainly attainable if the requests are for static files. If they are dynamic PHP or Ruby requests, a continuous 1 request/second is the most you can hope for.
– skrewlerMar 27 '12 at 23:25