2. Create and modify auto-scaling polices
With an auto-scaling policy, you can create rules that determine when the Auto-Scaling service will increase or decrease the number of instances of your application. In this task, create and modify rules for your Java Liberty application.
- In your application, click the Auto-Scaling service shown in the Connections list.
- Click CREATE AUTO-SCALING POLICY.
- Enter the parameters for the policy:
- Enter minimum and maximum number of application instances:
- Use the following default configuration or configure or as needed:
Minimum: If the number of the instances equals this value, the Auto-Scaling service will not scale in the application any more.
Maximum: If the number of the instances equals this value, the Auto-Scaling service will not scale out the application any more.
- Use the following default configuration or configure or as needed:
- Scroll to the Rule 1 section and make these changes:
- Keep the Metric Type set to Memory.
- Change Scale Out percentage to 30 and change Scale In to 15.
- In the Advanced Configurations section, set the Statistic Window to 30 seconds. Then, set a value of 60 seconds for Breach Duration and both Cooldown periods. You’ll use these smaller time frames for testing later.
These settings are much lower than in a typical production application. The values used are low enough to ensure that the Auto-Scaling service properly scales your application in a shorter test window during this lab.
- Enter minimum and maximum number of application instances:
- Click ADD A RULE to specify another rule.
- For Rule 2, set the Metric Type to throughput. Keep the other values as they were for Rule 1
- Click SAVE to apply all changes for Rule 1 and Rule 2
Your application will now automatically scale based on the policies that you defined.