About Me
Facebook
Facebook
Linked In
Linked In
Twitter
Twitter
YouTube
YouTube
Google +
Google +

September 20, 2015

Bluemix Application using Calendar-Based Rules


Introduction:
This article illustrates how to use the Bluemix Auto-Scaling service to make your application elastic by expanding the application runtime metrics, such as memory, response time, and so on. In particular, I will go into detail about a new feature in the Auto-Scaling service that lets owners assign calendar-based rules to scale out their applications to a minimum number in a certain time period. This feature is extremely useful for applications that require multiple node instances active during specific times.
Prerequisite
Ø  Bluemix account
Overview

Step 1. Create an application in Bluemix
Log in to Bluemix.
In your DASHBOARD, click CREATE APP.
We'll be creating a Java web application for illustration, so on the Choose Our App Template page, click WEB.
On the Choose a Starter page, choose Liberty for Java and click CONTINUE.
On the Name Your App page, enter a name for app. This name must be unique within Bluemix. Click FINISH. I have given as ‘Bluemix Calendar Based Rules
Step 2. Bind your app with an Auto-Scaling service instance
After our Java application is created and running, click Overview in the left column, then click ADD A SERVICE OR API.
In the Services list, check DevOps. On the DevOps page, select Auto-Scaling.
On the Auto-Scaling page, you will see your app details on the right in the Add Service column. Click USE to create an Auto-Scaling service instance and bind it with the application you just created.

When prompted to Restage Application, click RESTAGE.
Step 3. Create an Auto-Scaling policy
Create scaling rules. For help with assigning scaling rules, please refer to a previous Auto-Scaling article, "Make your application elastic on Bluemix."

 Choose a time zone. The schedules we create later will be triggered based on the selected time zone.
Click ADD A RECURRING SCHEDULE to create recurring schedule rules. For our example app, complete the four fields as follows:
·         Start Time: 13:00.
·         End Time: 13:15.
·         Repeat On: Every day.
·         Minimum Instance Count: 2.
Notes for Recurring Schedules:
·         Start Time must be earlier than End Time.
·         There are seven values in the Repeat On field, from Monday to Sunday. One or more can be selected. When all seven are selected, the field displays as Everyday.
·         The value of Minimum Instance Count must be smaller than the Allowable maximum instance count set in your scaling rules.
Create specific date schedule rules. In the Specific Date(s) window, click ADD A SPECIFIC DATE to create a specific date schedule. For our example app, complete the three fields as follows:
·         Start Date & Time: 6/3/2015 13:30.
·         End Date & Time: 6/3/2015 13:45.
·         Minimum Instance Count: 2.
Notes for Specific Date(s):
·         The value of Start Date & Time must be earlier than the End Date & Time.
·         The value of Minimum Instance Count must be smaller than the Allowable maximum instance count set in your scaling rules.
·         The specific date schedule takes precedence over the recurring schedule if there is overlap.
When done, click SAVE to save the policy.
Step 4. Monitor how the calendar-based rules work
Click the Scaling History tab to check the records of your scaling activity.
For our example app, the history list shows that at 1:00:43 PM the application was scaled out to 2 instances based on the Event Recurring schedule 1:00 PM triggered.
When we check the Metric Statistics tab after 13:50, we see that memory usage is now below the Lower Threshold 30% line.
Going back to the Scaling History tab, we see that the application has been gradually scaled in to 1 instance.
Checking the Scaling History tab a little later, we see that at 1:30:28 PM the application was scaled out to 2 instances based on the Event Schedule Sep 18, 2015, 1:30 PM triggered.
Clicking the Metric Statistics tab after 14:15, we see that memory usage is now below the Lower Threshold 30% line.
Checking the Scaling History tab again, we see that the application has been gradually scaled in to 1 instance.
Conclusion
So now you know how to make your application work with Auto-Scaling calendar-based rules on Bluemix. I hope this makes it easy for you to improve the elasticity of your applications and reduce overall costs when working on Bluemix.
Download
File Name
Size
Download
Bluemix Application using Calendar-Based Rules.pdf
700KB

0 comments :

Post a Comment

Designed By AMEER BASHA G