Upload
jeff-sloyer
View
284
Download
0
Embed Size (px)
Citation preview
IBM BluemixDynamically scale your application usingAuto-Scaling, BlazeMeter, and New Relic
Bluemix worksby elastically scaling your application
Jeff SloyerDeveloper Advocate
IBM Bluemix@jsloyer
I want to have control over the scaling behavior of my app
I have apps that need to scale based on changing load patterns
Enterprises need their applications to scale
“”
“”
I want to dynamically adapt my scaling strategy based on historical trends
“”
How can Bluemix scale my app?Bluemix offers the Auto-Scaling service to ease the process of handling application scaling
Dynamic scalingAutomatically add or remove instances to handle spikes in application usage
No cost to youThe auto-scaling service is free of charge for all users
You define the policiesScale your app based on CPU, memory, throughput, response time, and more
Scaling history Query past scaling activity based on status, time, and type
View historical metric dataVisualize the current and historical values of performance metrics
Save money By analyzing your scaling history and corresponding metrics, you can alter the scaling policies to keep your app highly available at lower costs to you
To handle varying loads and memory usage in your app, Bluemix enables the ability to scale in & out
Dynamic scaling based on your needs
You decide the initial number of instances and corresponding memory quota your app starts with
The Auto-Scaling service allows you to define custom policies that dictate your app’s scaling behavior
Auto-Scaling
View and analyze historical metrics
Monitor app metrics most important to you in real-time
Adapt your scaling policies based on historical scaling data in order to optimize your uptime and cut costs
Analyze historical performance metrics using the Auto-scaling dashboard
Demo
OverviewApplication displays current CPU utilization and memory usage of the
instance from which the page was served
Apply load to the application by creating a test in BlazeMeter
Once the application becomes stressed, a second instance will be provisioned and further traffic will be distributed between the instances
System Diagram
What you needBefore you begin, make sure you have the following:
BluemixYou need a valid Bluemix account with at least 256 MB and 3 services. The free trial provides these quotas.
Dev ToolingYou can use Bluemix’s powerful Dev Ops tools or easily bring your own. Download the Cloud Foundry CLI if you have not already.
Web BrowserFor this demo, we will be using the Google Chrome browser so we can take advantage of BlazeMeter’s Chrome extension.
NodeJS Packagesexpressnewrelicdust.jsconsolidatesocket.ioutilusagecron
Auto-Scaling
Create the appGitHub URL: https://github.com/IBM-Bluemix/auto-scaling-demo
Clone or download the above Git repository to your local machine.
Push the application to your Bluemix account using the Cloud Foundry CLI.
Change the ‘name and ‘host’ field in the package.json and manifest.yml files. These must be unique to Bluemix.
Add the Auto-Scaling serviceAdd/bind the Auto-Scaling service to your application and configure your scaling policy
Add/bind the Auto-Scaling service to your application.
Create an auto-scaling policy for your application with the settings to the right and save it.
Add the New Relic serviceAdd the New Relic service to monitor in-depth performance metrics
Add the New Relic service and bind it to your application.
Install the New Relic Node.js agent in your application by configuring the newrelic.js and app.js files and then restarting your app.
After the load test is complete, return to the New Relic app dashboard to see detailed historical metric data.
Add the BlazeMeter serviceAdd the BlazeMeter service and create a load test using the Chrome plugin
Add the BlazeMeter service. It does not bind directly to the application.
The application will scale out after the memory quota is exceeded for 30 seconds. Analyze the BlazeMeter test report after it completes.
Create a JMeter test using the BlazeMeter Chrome extension and run the test against your app.
Bluemix worksQuestions?
Additional ResourcesService Cataloghttps://console.ng.bluemix.net/?ace_base=true/#/store/cloudOEPaneId=store&serviceOfferingGuid=0f0f26e5-0562-46c9-afa2-353503ce1ddc&fromCatalog=trueAuto-Scaling Documentationhttps://www.ng.bluemix.net/docs/#services/Auto-Scaling/index.html#autoscalingBlazeMeter Documentationhttp://docs.run.pivotal.io/marketplace/services/blazemeter.htmlNew Relic Documentationhttp://docs.run.pivotal.io/marketplace/services/newrelic/Example apphttps://github.com/IBM-Bluemix/auto-scaling-demoBlog Posthttps://developer.ibm.com/bluemix/2015/04/03/handle-unexpected-bluemix-auto-scaling/