Whilst looking at how to scale applications in Windows Azure I have had the need to see how the nodes react when the number of cloud instances of a web or worker role change.

One way to view how the application would react and see the number of instances scale up or down is to use the development fabric that ships with the Azure SDK.

If we have a simple “Hello World” Azure application and configure it to use a single web and worker role we will have the following configuration and nodes.

Media_httpdomgreencom_rjztf

ServiceConfiguration for cloud application.

Media_httpdomgreencom_scazd

WebRole and Development Fabric.

Now that the application is running within the development fabric we want to increase the amount of instances that are running for one of the nodes. We can easily go back into Visual Studio and alter the ServiceConfiguration.csfg file to identify the number of nodes that we wish to have for our Web Role.

Media_httpdomgreencom_pzfbc

Updated ServiceConfiguration.

The problem with updating the Service Configuration in Visual Studio is that the changes do not get applied to the running service within the developer fabric, to get these changes applied we have to update the configuration of the running service with the newly saved config. This is done by executing a update on the service with the CSRun command line tool.

We can open the Windows Azure SDK Command Prompt and browse to the application directory containing the ServiceConfiguration.cscfg for the project we are running ( ..\Projects\WindowsAzureDevFabricProject\WindowsAzureDevFabricProject ). From here we make the following call into the development fabric with CSRun:

csrun /update <deployment-id>;<new-configuration-to-apply>

csrun /update 46;ServiceConfiguration.cscfg

The deployment ID, 46 in our example can be found by looking in the development fabric simulator environment. Using this and the new configuration (updated in Visual Stuido) we have now been able to scale up our web role and add an extra node to the application.

Media_httpdomgreencom_ejfye

CSRun Command and Development Fabric with added node


You will now be able to scale by increasing and decreasing the number of nodes in the development fabric, giving you the ability to debug and view how your application manages with these configuration changes.

Happy Scaling

Media_httpdomgreencom_jbgca