Rackspace Auto Scale is an excellent feature which has no additional cost except the cost of servers needed to be added on demand. It is basically quite normal for servers running badly coded web softwares with more badly coded plugins like WordPress to have high demand of resources. Just like we have outlined on the article RAM and CPU Needed For Cloud Server to Run WordPress, for practical purpose we can not continuously pay for a 120 GB cloud server group (nodes) setup aprrehending when the traffic will increase. What we can do is to use the Rackspace Auto Scale feature combined with Rackspace Image Creation feature. It is taken that, the Database of the Setup is based on Cloud Database and permission of database user is set to wildcard – %
for the Database associated with the WordPress Setup.
Rackspace Auto Scale To Handle Traffic Spike : Understanding What It Can Do
Official documentation is written by Sanjay Sohoni here :
1 | http://www.rackspace.com/blog/scale-up-and-down-based-on-load-with-rackspace-auto-scale/ |
Basic settings goes like this :
---
So the first group of settings consists of :
Group Name, Region, Minimum Cooldown time, Minimum active servers, Maximum active servers, Selecting Server Image, Server Flavor and Load Balancer. Except Selecting Server Image, there should be no doubt. As WordPress is not a Static Material, the image should be manually changed to capture the latest working server image. Obviously, the last post probably get a soft 404, it is acceptable when the whole website could go off.
Understanding Policy and API Related to Rackspace Auto Scale To Handle Traffic Spike
You will need to create a policy depending on the examples provided on API documentation :
1 | http://docs.rackspace.com/cas/api/v1.0/autoscale-devguide/content/POST_createPolicies_v1.0__tenantId__groups__groupId__policies_autoscale-policies.html |
Normally, the thresholds in Cloud Monitoring will trigger the scaling activities. To add more control, you can use webhook like :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | [ { "change":1, "cooldown":1800, "name":"scale up by seven servers", "type":"webhook" }, { "changePercent":-5.5, "cooldown":1800, "name":"scale down by 5.5 percent", "type":"webhook" }, { "cooldown":1800, "desiredCapacity":7, "name":"set group to 7 servers", "type":"webhook" }, { "args":{ "cron":"23 * * * *" }, "changePercent":-5.5, "cooldown":1800, "name":"scale down by 5.5 percent at 11pm", "type":"schedule" }, { "args":{ "at":"2013-12-05T03:12:00Z" }, "changePercent":-5.5, "cooldown":1800, "name":"scale down by 5.5 percent on the 5th", "type":"schedule" } ] |
The example is possibly most complicated, but shows the usage of args
.