This is documentation for Apprenda 7 and 8.
Documentation for older versions are also available.

Managing Application Deployment and Scaling

When a version of an application is in the Definition, Sandbox, or Published stage, you can view and manage the number of deployed application component instances, as well as control how instances are deployed or undeployed based available resource or scheduling factors. Managing instance deployment through the Scale tab allows you maximum flexibility in controlling your application's availability in different conditions. It should be noted that the settings described below can also be initially set through a Deployment Manifest. If no Scaling settings are configured for a component, Manual scaling is set by default with an Instance value of "1" for all component types (except Windows Services, in which case the Instance value will be set to "0").

To view the Scaling settings* for a version of an application that is in the Definition, Sandbox, or Published stage, when viewing an application version's overview in the Developer Portal, click on the Scale tab, then click on the Components sub-tab.  This will take you to the Scaling settings page, which initially lists all application components included in that version (to filter the list by a specific application component type, select that type from the Application Tier dropdown menu):

Three different Scaling Modes (Manual, Automatic, and Scheduled) can be used for the management of deployed instances of application components.  Depending on the type of application component and the setting configuration of your application, the availability of some scaling models may be limited for a specific application component.

Manual Scaling

Manual scaling allows you to explicitly set the exact deployed instance count of your app component.

When you select Manual scaling for an application component, there are two ways to set the Instances count. The first is by typing the desired value into the corresponding input field to the right, which will cause the slider to the left to reposition itself in order to reflect the value you entered.  The second method is by dragging the slider on the left to reflect the instance count you wish to set, in which case the value in the input field to the right will update to reflect the slider values. 

Note: By default, the slider bar displays a range of 20.  If you wish to set a count to a value larger than 20 using the sliders, click the 20+ button to the right of the slider bar, and the bar will scale out by 20.  You can repeat this scale-out until the slider bar has the range you desire.

If you desire to restore the settings that were in place for the currently-viewed component scaling setting before you changed them, click the Reset button; to cancel all scaling setting changes you updated for all components on this screen, click the Cancel button in the lower right.  If you are happy with your scaling settings, click the Save button in the lower right.  The instance count you set will now be enforced by the Apprenda Platform. Any instance deployments/undeployments required to meet the current instance count you set will be queued up and then executed at a regular interval configured by your Platform Operator.

Underneath the slider bar, the Current Policy assigned to the component whose settings you are updating is displayed, along with its CPU and RAM allocations; in order to update the Resource Policy assigned to the component, click the arrow button to the right of the policy info to be redirected to the Resource Policy assignment tab.

Automatic Scaling

Having Automatic scaling set for an application component will cause the Apprenda Platform to dynamically scale up or down the component's deployed instance count depending on CPU utilization levels tracked for currently-deployed instances of that component.  The deployed instance count will, however, always stay within a range that you set.

Please Note: Automatic scaling will only be available for application components if Resource Throttling is enabled on the Apprenda Platform; contact your Platform Operator for more details.

When you select Automatic scaling for an application component, decisions on whether to scale up or down the deployed instance count for a component will be made by the Apprenda Platform based on parameters selected by the Platform Operator; you will see summaries of the rules to be used for scaling decisions next to the Scale Up and Scale Down labels above the slider bar.  For example, the above screenshot shows that the Platform will decide to deploy an additional component instance (Scale Up) "When CPU Utilization is > 90% for more than 2 minutes."  This means that, over any given 2-minute period, if the average CPU consumption of all deployed instances of that component exceeds 90% of the CPU limit allocated by that component's assigned Resource Policy, the Platform will deploy an additional instance of the component.  Similarly, the Platform will Scale Down a component instance if the average CPU consumption of all deployed instances of that component is less than 10% of the CPU limit allocated by that component's assigned Resource Policy.  For convenience, the currently-assigned Resource Policy, along with the CPU and RAM allocations for that policy, are displayed below the instance slider bar, and you can update the policy assignment by clicking the arrow icon to the right (in which case you will be redirected to the Policies sub-tab).

Since they are instituted by Platform-wide settings, the Scale Up/Scale Down rules applied by Automatic scaling cannot be amended here, but the instance count range within which Automatic scaling will be applied can be set here.  You can set Min Instances and Max Instances values** so that the instance count for the component in question will never exceed the maximum or fall below the minimum.  You can do this either by entering values in the appropriate input fields to the right, or by adjusting the instance sliders on the slider bar to the left. The leftmost and rightmost light blue sliders represent the min instance and max instance thresholds. 

Please Note: By default, the slider bar displays a range of 20.  If you wish to set a count/threshold to a value larger than 20 using the sliders, click the 20+ button to the right of the slider bar, and the bar will scale out by 20.  You can repeat this scale-out until the slider bar has the range you desire.

If you desire to restore the settings that were in place for the currently-viewed component scaling setting before you changed them, click the Reset button; to cancel all scaling setting changes you updated for all components on this screen, click the Cancel button in the lower right.  If you are happy with your scaling settings, click the Save button in the lower right.  The Platform will now auto-scale the component instance count within the min/max instance thresholds you set.

** Minimum and maximum instance count enforcement is done on a per-Cloud basis for each Cloud that has at least a single deployed instance of the app component in question.  For example, Component X has a minimum instance count of 4 set; if an instance of Component X is deployed to Cloud A, but no instances are deployed to Cloud B, the Platform will enforce the min instance count on Cloud A and deploy 4 total instances there, but none to Cloud B.  If an instance is deployed/moved to Cloud B, however, the Platform will also enforce the min instance count on Cloud B as well, resulting in a situation where 4 additional instances are deployed to Cloud B as well, making 8 total instances of Component X deployed across all Clouds.  Instance count enforcement is done this way to ensure the desired application availability across all Clouds that actively host an application's components.

Scheduled Scaling

Scheduled scaling allows you to set a weekly schedule that determines the deployed instance count for a given component; the instance count will be scaled up or scaled down at the time and day of the week specified in order to meet the count requirement specified by the schedule.

When you select Scheduled scaling for an application component, you must fill out the schedule matrix which defines deployed instances counts to be met for the component at specified day/time combinations. Days of the week are represented in columns in the schedule matrix, and times of day are represented in rows which can be added or removed. 

To add a row, click the +Add Row icon below the matrix, and to remove a row, click the X icon to the right of that row.

To edit a row,

  1. edit the Time column to define the time of day for deployed instance count. Enter time values as local times, they will be converted to UTC time values by the Platform when the settings are saved. For your reference, the UTC Column will be automatically updated as you change the Time column to show the equivalent time in UTC
  2. edit each Day column to the desired instance count value for that time that the Platform should enforce

Add as many rows for specific times of day until you've defined a full matrix of day/time values that will constitute the weekly instance scaling schedule for the application component. At each specified time on each specified day of the week, the Platform will automatically scale up or scale down the deployed instance count for the component to meet the count value you entered.  Furthermore, once a scaling action has been taken at a set day/time, the set instance count will be maintained until the next scaling action on the timeline.

In Platform versions before 7.1.0, if any matrix inputs in the grid are left blank, they will be converted to 0 after saving your settings, so if you would like to maintain a specific instance count across a time span that contains multiple scaling events on the grid, set those values to the instance count you would like to maintain as opposed to just leaving them blank.

In Platform version 7.1.0 and after, the Platform will use the value from the last defined instance count for that time as the desired instance count for blank values. Developers will now need to explicitly place 0 into a scheduled time to schedule 0 instances of an application component.

Please Note: Times defined in the schedule matrix must be separated by intervals of at least 5 minutes, so if one scheduling event is set for 2:00 PM, the next scheduling event can be set no earlier than 2:05 PM.

If you desire to restore the settings that were in place for the currently-viewed component scaling setting before you changed them, click the Reset button; to cancel all scaling setting changes you updated for all components on this screen, click the Cancel button in the lower right.  If you are happy with your scaling settings, click the Save button in the lower right.  The deployed instance count for the component will now be enforced by the Platform on a weekly based on the values in the schedule matrix.

To the right of the schedule matrix, the Current Policy assigned to the component whose settings you are updating is displayed, along with its CPU and RAM allocations; in order to update the Resource Policy assigned to the component, click the arrow button to the right of the policy info to be redirected to the Resource Policy assignment tab.

Temporary Platform Operator Overrides

Platform Operators can adjust the number of deployed workloads for a component, which creates a temporary override of any Scale settings configured for that component through the Developer Portal. When such an override is in place, the Developer Portal will notify you by displaying the override information on the Scale settings page:

 

As needed, you may select the Cancel this override option to remove the override and reinstate control over the Scaling settings for the component. Please note that, in addition to selecting the Cancel this override option, you must also select Yes on the resultant confirmation prompt and click the Save button at the bottom of the Developer Portal controls.

Limitations to Scaling Capability for Specific App Components

Limitations for User Interface Components

If Multi-tenancy is set as your application's User Access Model and Isolated is set for the UI Model, only Manual scaling will be available for the user interface component.  Also, since each Web Server can only host a single deployed instance of a specific user interface component, the number of deployed UI instances for a component cannot exceed the total number of Web Servers on your Apprenda environment.

Limitations for Windows Service Components

Since each Application Server can only host a single deployed instance of a specific Windows Service component, the number of deployed Windows Service instances for a component cannot exceed the total number of Application Servers on your Apprenda environment.

Limitations for Java Web Application Components

Depending on the value configured for the Hosting.Wars.AllowWorkloadHorizontalScalingOnSingleNode Registry Setting by your Platform Operator, the Platform may be configured to allow each Linux Server to host only a single deployed instance of a specific Java Web Application component. In this case, the number of deployed Java Web App instances for a component cannot exceed the total number of Linux Servers on your Apprenda environment.

Limitations for Database Components

Scaling settings will only be available for an application's database component if Multi-tenancy is set as your application's User Access Model and Commingled is set for the Data Model.  In this case, only Manual scaling will be available, and only on a limited basis; min and max instance settings will not be available, and you will only be able to manually scale up the number of deployed DB instances.  Once a DB instance is created in this way, it can't be scaled back through this page.


*The Scale tab in the Developer Portal does not indicate the current number of deployed instances of a component which, under certain circumstances may deviate from the values expected based on Scaling settings. You can view the current instance count for a component through the Monitor tab for the application version.