Ways to perform PaaS Auto-Scaling Test – OpenShift

In PaaS, if Auto-Scaling is enabled for an application, the application would dynamically increase / decrease its number of instances in response to load. In Cloud Foundry alike (Pivotal Cloud Foundry, ActiveState Stackato, IBM BlueMix), they are mostly CPU driven. In OpenShift, it is driven by web traffic.

0. F5
No, not your F5 load balancer, but simply pressing F5 repeatedly against your browser to refresh the page. This works sometimes depending your finger speed, but usually not enough, there are other ways to generate mass traffic against your application.

1. a simple script that calls your app in a loop
in linux, on your command line:
> for i in {1..10000}; do curl -s http://yourapp.example.com > /dev/null; usleep 50000; done

2. Apache HTTP server benchmarking tool

Because we are talking about OpenShift here, which uses Apache to serve up your pages, you would have the Apache HTTP Server Benchmarking tool – ab installed on one of your nodes.

Log on to your node and run on the command line:
> ab -t 100000 -c 5 http://yourapp.example.com

check here for ways to tweak your ab test.

Go to your application’s Web Load Balancer and look for signs of traffic.
Another instance (“gear”) should spin up itself after a few minutes.
Note, in OpenShift v2, you can only enable auto-scaling when you FIRST create the application. You cannot enable it after. (WHAAAT)

After your traffic has die down, it should also scale down itself. By default I believe it takes 15 minutes after the lessening the traffic to take effect.

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