Skip to content

Latest commit

 

History

History
65 lines (36 loc) · 2.52 KB

app-autoscaling.adoc

File metadata and controls

65 lines (36 loc) · 2.52 KB

Application Autoscaling

Reading

Cloud Foundry has some services for auto scaling applications. These serve as a starting point and may work for some of your application portfolio. Read about them on pivotal site.

Try following the directions above for your app.

A good start for load testing is jMeter. You can download that here. jMeter requires you have a JDK installed!

Goal

In this section you will leverage Pivotal’s Autoscaling Service to scale your microservice.

Exercise

Configuring Autoscaling

  1. Using Apps Manager, create a new instance of the Autoscaler from the Marketplace.

    • Be sure to name your service instance: <first-initial><last-initial>-cities-service-autoscaler

    • Be sure to select the Gold plan

    • Bind this instance to your cities-service

  2. Follow the instructions on Autoscaling to configure and enable your autoscaling service.

  3. Launch the autoscaling dashboard for your service.

Set memory to ensure scaling will happen

Be sure to set the memory allocation for your application to 650M to ensure the application will scale.

Generating Load and Observing Results

  1. Apache JMeter Can be used to generate load.

  2. Use the following JMeter script as a starting point. Thanks Guillermo Tantachuco!!!

  3. Open the 'cities-load-generator.jmx' in the JMeter GUI.

  4. Expand the content of the JMeter test plan by: i) selecting the 'Load Generator' test plan on the left pane; and, ii) going to the menu: 'Option → Expand All'

  5. Edit the test plan to use your application’s URL. To do so, change the 'Server Name or IP' field on the 'HTTP Request Defaults' item.

  6. Save the test plan: 'File → Save'

  7. Run the test plan: 'Run → Start'

  8. Use both the developer console and the auto-scale console to observe your service scale up and back down based on load. [Optional] See app metrics on the App Dynamics' console.

  9. Stop the test plan: 'Run → Stop'

Checking your work

  1. An autoscaling service instance should show correctly under the VCAP_SERVICES environment variable.

    $ cf env <first-inital><last-initial>-cities-service
  2. Your app should scale up when the jmeter script is executed and back down after the script completes.