Bend it like Bluemix, MongoDB using Auto-scale – Part 1!


In the next series of posts I turn on the heat on my cloud deployment in IBM Bluemix and check out the elastic nature of this PaaS offering. Handling traffic load and elastically expanding and contracting is what the cloud does best. This is  where the ‘rubber really meets the road”. In this series of posts I generate the traffic load using Multi –Mechanize a performance test framework created by Corey Goldberg.

This post is based on an earlier cloud app that I created on Bluemix namely Spicing up a IBM Bluemix Cloud app with MongoDB and NodeExpress. I had to make changes to this code to iron out issues while handling concurrent  inserts, displays and deletes issued from the multi-mechanize tool and also to manage the asynchronous nightmare of Nodejs.

The code for this Bluemix, MongoDB with Auto-scaling can be forked  from Devops at bluemixMongo. The code can also be cloned from GitHub at bluemix-mongo-autoscale

1.  To get started, fork the code from Devops at bluemixMongo. Then change the host name in manifest.yml to something unique and click the Build and Deploy button on the top right in the page.

26

1a.  Alternatively the code can be cloned from GitHub at bluemix-mongo-autoscale. From the directory where the code is cloned push the code using Cloud Foundry’s cf command as follows

cf login -a https://api.ng.bluemix.net

cf push bluemixMongo –p . –m 128M

2. Now add the MongoDB service and click ‘OK’ to restage the server.

3

3. Add the Monitoring and Analytics (M & A) and also the Auto-scaling service. The M& A gives a good report on the Availability, Performance logging, and also provides Logging Analysis. The Auto-scaling service is the service that allows the app to expand elastically to changing traffic loads.

4

4. You should see the bluemixMongo app running with 3 services MongoDB, Autoscaling and M&A

5

5. You should now be able click the bluemixMongo.mybluemix.net and check the application out.

6.Now you configure the Overload Policy (auto scaling) policy. This is a slightly contrived example and the scaling policy is set to scale up if the Memory exceeds 55%. (Typically the scale up would be configured for > 80% memory usage)

6

7. Now check the configured Auto-scaling policy

7

8. Change the Memory Quota as appropriate. In my case I have kept the memory quota as 128 MB. Note the available memory is 640 MB and hence allows up to 5 instances. (By the way it is also possible to set any other value like 100 MB).

5

9. Click the Monitoring and Analytics service and take a look at the output in the different tabs

8

10. Next you need to set up the Performance test tool – Multi mechanize. Multi-mechanize creates concurrent threads to generate the load on a Web site or service. It is based on Python which  makes it easy to modify the scripts for hitting a website, making a REST call or submitting a form.

To setup Multi-mechanize you also need additional packages like numpy  matplotlib etc as the tool generates traffic based on a user provided script, measures latency and throughput besides also generating graphs for these.

For a detailed steps for setup of Multi mechanize please follow the steps in Trying out multi-mechanize web performance and load testing framework. Note: I would suggest that you install Python 2.7.2 and not the later 3.x version as some of the packages are based on the 2.7 version which has a slightly different syntax for certain Python statements

In the next post I will run a traffic test on the bluemixMongo application using Multi-mechanize and observe how the cloud app responds to the load.

Watch this space!
Also see
Bend it like Bluemix, MongoDB with autoscaling – Part 2!
Bend it like Bluemix, MongoDB with autoscaling – Part 3

You may like :
a) Latency, throughput implications for the cloud
b) The many faces of latency
c) Brewing a potion with Bluemix, PostgreSQL & Node.js in the cloud
d)  A Bluemix recipe with MongoDB and Node.js
e)Spicing up IBM Bluemix with MongoDB and NodeExpress
f) Rock N’ Roll with Bluemix, Cloudant & NodeExpress

Disclaimer: This article represents the author’s viewpoint only and doesn’t necessarily represent IBM’s positions, strategies or opinions

Advertisements

26 thoughts on “Bend it like Bluemix, MongoDB using Auto-scale – Part 1!

  1. Pingback: Bend it like Bluemix, MongoDB using Auto-scaling – Part 2! | Giga thoughts …

  2. Pingback: Latency, throughput implications for the Cloud | Giga thoughts …

  3. Pingback: Analyzing cricket’s batting legends – Through the mirage with R | Giga thoughts …

  4. Pingback: A crime map of India in R – Crimes against women | Giga thoughts …

  5. Pingback: A peek into literacy in India: Statistical Learning with R | Giga thoughts …

  6. Pingback: Informed choices through Machine Learning – Analyzing Kohli, Tendulkar and Dravid | Giga thoughts …

  7. Pingback: Working with Node.js and PostgreSQL | Giga thoughts …

  8. Pingback: What’s up Watson? Using IBM Watson’s QAAPI with Bluemix, NodeExpress – Part 1 | Giga thoughts …

  9. Pingback: Re-working the Lucy Richardson algorithm in OpenCV | Giga thoughts …

  10. Pingback: Hand detection through Haartraining: A hands-on approach | Giga thoughts …

  11. Pingback: Experiments with deblurring using OpenCV | Giga thoughts …

  12. Pingback: De-blurring revisited with Wiener filter using OpenCV | Giga thoughts …

  13. Pingback: Deblurring with OpenCV: Weiner filter reloaded | Giga thoughts …

  14. Pingback: Powershell GUI – Adding bells and whistles | Giga thoughts …

  15. Pingback: Installing and using OpenCV with Visual Studio 2010 express | Giga thoughts …

  16. Pingback: Adventures in LogParser, HTA and charts | Giga thoughts …

  17. Pingback: Tips for building a decent HTA/HTML application | Giga thoughts …

  18. Pingback: Stir fry a VBA with Excel application quickly | Giga thoughts …

  19. Pingback: Building a respectable VBA with Excel Application | Giga thoughts …

  20. Pingback: Get your feet wet with Powershell GUI | Giga thoughts …

  21. Pingback: Bend it like Bluemix, MongoDB with auto-scaling – Part 3 | Giga thoughts …

  22. Pingback: Cricket analytics with cricketr in paperback and Kindle versions | Giga thoughts …

  23. Pingback: Introducing cricket package yorkr:Part 4-In the block hole! | Giga thoughts …

  24. Pingback: yorkr crashes the IPL party! – Part 4 | Giga thoughts …

  25. Pingback: Going deeper into IBM’s Quantum Experience! | Giga thoughts …

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s