How to Scale Applications by Increasing or Decreasing the Number of Role Instances
Updated: June 13, 2011
Windows Azure allows you to scale your hosted service to meet capacity demands by increasing or decreasing the number of role instances that are running as part of your hosted service. To increase or decrease the number of role instances, you must modify the Instances element within the service configuration file.
Important |
|---|
| For a hosted service to qualify under the Windows Azure SLA a role must be deployed with two or more role instances. For more information, see Service Level Agreements. |
-
Open the ServiceConfiguration.cscfg file for your hosted service in the text editor.
-
Locate the Instances element of the role for which you are changing the number of instances. Update the value of the count attribute to reflect the new number of instances of the role.
… </ConfigurationSettings> <Instances count="1" /> <Certificates> ---
Note Increasing the number of instances of a running role increases the compute hours that are billed. For more information on how computer hours are billed, see see Windows Azure Billing Basics. -
Save the ServiceConfiguration.cscfg file.
-
Log on to the Windows Azure Platform Management Portal.
-
In the upper portion of the navigation pane, click Hosted Services.
-
In the services and deployments window, expand the subscription that contains the hosted service for which you are changing the number of the role instances.
-
Expand the hosted service for the deployment.
-
Click the deployment for which you are changing the configuration.
-
On the ribbon, in the deployments section, click Configure.
-
On the Configure Deployment dialog click Browse. Navigate to the location of the service configuration file, select the configuration file, and click Open.
-
Click OK.
Note |
|---|
| It is possible to update the instance count by editing the configuration in the portal. It is recommended that you do this only during testing of a hosted service. If you do not make the change in the service configuration file of your Windows Azure project, the next time you package and deploy the hosted service, the number of role instances will revert to the previous value. |
See Also
- 1/10/2011
- Tom Hollander
Important