Question

Is there a way do do dynamic elasticity in Windows Azure? If my workers begin to get overloaded, or queues start to get too full, or too many workers have no work to do, is there a way to dynamically add or remove workers through code or is that just done manually (requires human intervention) right now? Does anyone know of any plans to add that if its not currently available?

Was it helpful?

Solution

There's a Service Management API, and you can use that to scale your application (from code running in Windows Azure or from code running outside of Windows Azure).

http://msdn.microsoft.com/en-us/library/ee460799.aspx and http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=windowsazuresamples&ReleaseId=3233.

OTHER TIPS

Microsoft shipped the Autoscaling Application Block (Wasabi) to provide dynamic scaling. Some of the supported scenarios:

  1. Autoscaling both web and worker roles in Windows Azure by dynamically changing instance counts or performing application throttling.
  2. Autoscaling Windows Azure roles based on timetables.
  3. Autoscaling Windows Azure roles based on metrics collected from the application and/or Windows Azure but constrained by upper and lower bounds on the instance count per role.
  4. Preventing fast oscillations in the number of role instances with the stabilizer. The stabilizer can also help to optimize costs by limiting scaling up operations to the beginning of the hour and scaling down operations to the end of the hour.
  5. Monitoring and logging autoscaling activity.
  6. Sending notifications to preview any scaling operations before they take place.
  7. Encrypting the rules and other configuration in Windows Azure blob storage or in local file storage.
  8. Managing the autoscaler configuration by using Windows PowerShell.

A comprehensie sample application (Tailspin Surveys) showcasing all these features is provided (installation instructions are available here). Also, check out the Developer's Guide and the Channel9 video walkthrough.

The block is available as standalone download of binaries, source or via NuGet.

Here are a couple of talks/demos showing Wasabi in action:

Windows Azure has just added the autoscaling feature built into the platform. Now it's trivially easy to configure your autoscaling rules right in the management portal: Configuring autoscaling based on CPU utilization in Windows Azure

See the announcement and the demo. I've also written a post comparing Windows Azure Autoscale to Wasabi and outlining the path forward.

  1. Create a queue named autoscale.[your_role_name].instance_count
  2. In the Management Portal, set the autoscale to Queue.
  3. Set the Target Count field to 1.

Now you can use standard enqueue and dequeue operations on that queue to control the number of worker role instances. You've got 7 days to process a message before it expires, so you might want to create a worker role that can ensure that the number of messages in the queue is tracking your target instance count.

If you're after dynamic elasticity, you've probably already got a worker-role-based controller in mind already, so that's probably not a problem.

Lokad.Cloud open source project for Windows Azure contains distributed executor framework. Among other things it provides auto-scaling with VM provisioning feature.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top