Scale out, not up… Cloud Architecture 101

scaleA common question that I get is how to cut down on one’s Azure bill. People will come to me because they are finding a way to control their spend in Azure while not hurting their service levels. Most of these folks are big proponents of the cloud because of how agile they can be and the fact that it’s got geo-replicated content and traffic and so on.

The first time that I saw this question, I was thinking that this could be tough to tackle as Azure’s pricing is fairly aggressive until I saw their architecture. And it turns out that in most cases, it’s the same issue.

A very common architecture is two large web role instances or so in front of a small worker role instance with some storage plus a SQL Azure database. The basic problem here is that the two large instances means that their unit of scale is a large instance which is an 4 core box with 7 gig of memory that costs about $345 a month to run. This is not leveraging cloud computing. There are definitely times where you need a big iron box but for 99% (made up statistic) of web apps, it’s overkill. Actually, overkill is the wrong term, it’s scaling vertically by throwing bigger hardware at a problem rather than what the cloud is really good at which is scaling horizontally.

The fundamental difference between architecting for cloud verses architecting for old school on premise or fixed contract hosting is that in the old world you had to architect and build for the maximum and hope you never hit it. In the new world of cloud computing, you architect for scaling out horizontally and build for the minimum. This means building small stateless servers that can be added or thrown away on an hour by hour basis.

The fix to these customer’s cost issues is simple, move from 2 larges into how ever many smalls you need and then scale up or down as needed.

The reason that they were running 2 larges rather than 2 smalls is that they are concerned about traffic spikes and the site going down. I completely get that and there are a number of great solutions to this issue. We don’t “auto-scale” automatically in Azure. The reason for this is simple, we charge your for instances that are spun up so it’d be in our interest to aggressively spin up new instances and charge you for them. To avoid even the appearance of impropriety, we don’t auto-scale. However, we give you all of the tools to write your own auto-scaling or manage it remotely.

How do you know how many instances you should be running? Go to the Windows Azure portal and look at your current usage. There’s a ton of diagnostics available through the portal. You should go spelunking there and see what all they have. Some folks are running as low as 1-2% utilization whereas we are pushing for folks to try and run on average between 70 and 80% utilization. In a traditional data centre, we’d never never want for that to be our “normal” for fear of spikes but in Azure, your spikes can be soaked up by the rest of the infrastructure.

Once you figure out where your normal should be, build that out and then use some of the tools to scale up or down as needed.

Mobile tools:

http://udm4.com/iPhone/CloudTools_for_Windo-701342. That’ll give you health stats on your instances and then you can turn them on and off from the phone.

http://mobilepcmonitor.com/ – will let you know when your site has any issues at all. X amount of memory being used, X number of users, server goes down and the like. Clients on iphone, windows phone, windows 8, windows 7 and so on.

 

Autoscale with your own code:

http://archive.msdn.microsoft.com/azurescale – auto-scaling yourself sample all.

http://channel9.msdn.com/posts/Autoscaling-Windows-Azure-applications – Windows Azure Application Block that does auto-scaling for you.

http://channel9.msdn.com/Events/WindowsAzure/AzureConf2012/B04 – more great content on how to do this yourself.

 

Third parties to manage your scale:

http://www.paraleap.com/AzureWatch offers monitoring and auto-scaling.

http://www.azure-manager.com/ – does what it says on the tin. Manages azure for you.

http://www.italliancegroup.com/ – does a managed service/partnership where they manage your infrastructure in Azure.

 

In short, if you are looking at cloud computing, make sure that you architect for the right kind of scaling…

Leave a Reply

Your email address will not be published. Required fields are marked *