I am having some debating around scaling Amazon EC2 instances. I have developed my app using ASP.NET, so I have to choose to go with a Windows EC2 instance. MySQL and images are served from other instanced, so the scaling goes (for now) only for the web application instance.
My options (for now):
- Small 64bit instances - Start with a Small instance 32bit, create an Elastic Load Balancer, add more small instanced on demand when traffic rises (depends on the CloudWatch specs that I setup).
- Medium High-CPU instances - Start with a Medium High-CPU instance (costs more, but more powerful), create an Elastic Load Balancer, and add more Medium High-CPI instances when needed.
The first option is cheaper, and allows the application to scale gradually, compared to the Medium instance, The Medium instance only works with 32bit, so I am kind of locked to the 32bit. I don't want to scale up, as I prefer to scale horizontally. That means that when the traffic is low, I won't pay the high price of the Medium instance. So with the second option I can choose to go with a 64bit small instance, and scale horizontally by adding more servers under the Elastic Load Balancer automatically depends on the specs gotten from Amazon CloudWatch (ie. CPU, RAM, etc.).
My problem is that I have problem to decide which one to go for. I've read that the Medium High-CPU instance is 5x more powerful than the Small one. But the price is a bit to aggressive to start with. In general, I prefer paying less and scale when needed by adding more small instanced.
I need your help in choosing which way to go. What the advantages of each approach? Why it's better to get the Medium high-CPU compared to small in terms of horizontal scaling, if there is an advantage. After all, the all idea around a cloud architecture is to be able to save costs on servers that you don't need their computing power in a given time frame.
I did the best to optimize the instance by using caching for both the page and SQL queries to MySQL (that exists on Xeround, which solved the problem of scaling when it comes to DB). My DB is relatively small (1000 rows with not so much data), so the 1.7GB of ram on the small instance is ok for my caching needs. I think that the main issue will be on the CPU when traffic rises. Furthermore, the storage is also very small, hosting just my website ASPX pages.
I assume that the application can attract ten thousands of visitors each day, maybe more. So scaling is a must - BUT will a small instance horizontal scaling is a smart move? - Will it be smarter choice for even high traffic web applications?
Right now I am more towards the small instance + Elastic Load Balancer solution. It seems logical to pay less and pay more as the application grows.
Waiting for your knowledgeable answers. Thanks.
By all means start small. You can always move to a larger instance size at any time. If you're designing with horizontal scaling in mind, the back-end could be any mixture of systems.
If CPU is really the bottleneck then medium is the better deal since it's 5x the CPU for 2x the cost. However I suspect your bottleneck will be with file io, in which case a medium may only slightly outperform a small.