How Auto Scaling works in Apache Stratos

Posted: May 19, 2014 in Uncategorized

This article is an extension of the article titled “Auto Scaling with Apache Stratos”, which was explaining the basics of the Stratos auto scaling. This article explains how Stratos components work together to perform auto scaling.

Let’s consider a simple scenario where a user has subscribed to a PHP cartridge. Assume there are two PHP instances currently running in the system. Figure 1 depicts the similar type of environment. Stratos components such as AS (Auto Scaler), CC (cloud controller), CEP (Complex Event Processor) are publicized inside the blue box. PHP instances and load balancer instance are shown in the green box.

Every PHP instance and Load Balancer instance has Stratos Cartridge Agent, running inside them which communicate with Stratos system.

The undermining operations of the Auto Scaling are list down below.

How Auto Scaling works in Apache Stratos

How Auto Scaling works in Apache Stratos

  1.  PHP instances periodically send their Memory Consumption and Load Average values to CEP via Thrift protocol.
  2. Load balancer instance periodically send its Requests In Flights (RIF) of PHP cluster to CEP.
  3. CEP aggregates the Memory consumption, load average and RIF and sends the aggregated results to the “Summarized Health Stats” topic of Message Broker.
  4. Auto Scaler receives the message of the aggregate results, since it has subscribed to the above topic.
  5. Scaling rules which are running periodically inside the Auto Scaler, compares the received aggregate results with the Auto Scaling policy.

    If received values of results are above the thresholds values of the auto scaling policy, AS will decide to scale up, else keep calm.

    When the peak time is approached, large number of users request your PHP apps, then;

    • RIF count of LB might increase since there are more requests
    • PHP instances will have to serve more requests which will create more threads, thus increase the memory Consumption of the nodes.
    • More the requests, more the load average will be.

    This will lead current aggregate results to exceed the thresholds values in the Auto Scaling policy.

    At the time when AS decided to scale up, AS asks Cloud Controller (CC) to start a new PHP instance.

  6. CC spawns a new PHP instance.
  • Recently created PHP instance is now a member of the same PHP cluster.
  • Load balancer add the newly created PHP instance to its cluster and start forwarding the user requests to new member as well.
  • This PHP instance will start sending its Memory Consumption and Load Average details to CEP.
Advertisements

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