Scale a WordPress Production-Ready deployment horizontally or vertically
The Bitnami WordPress Production-Ready Stack deploys an Auto Scaling group to ensure high availability.
TIP: Refer to the architecture page for more information about the HA architecture and its benefits.
This section describes the available options to scale your Bitnami WordPress Production-Ready Stack instances horizontally and vertically.
The Auto Scaling group starts by deploying as many instances as indicated in its desired capacity. When an instance becomes unhealthy, the Auto Scaling group terminates it and launches a new one to replace it.
To dynamically increase or decrease the number of instances, you can create scaling policies. When a scaling policy is in effect, the Auto Scaling group automatically launches or terminates instances as needed. By default, this solution configures a single policy to maintain the instances’ average CPU utilization at 75%.
View existing scaling policies
You can consult existing policies, as follows:
- Log in to the AWS Autoscaling console.
Under the “LOAD BALANCING” menu, click the “Auto Scaling Groups” link to display the Auto Scaling groups.
Select the Auto Scaling group for your stack and click the “Scaling Policies” tab in the lower panel.
Detailed information about the existing scaling policies will be displayed.
Create new scaling policies
You can add new scaling policies (based on CPU utilization, network usage or number of requests), as follows:
- Access the Scaling policies dashboard.
Click the “Add Policy” button and add a new policy filling the values below:
- Name: Choose a descriptive name for your policy.
- Metric Type: Choose one of the available metrics: “Average CPU utilization”, “Application Load Balancer Request Count per Target”, “Averate Network In (Bites)” or “Averate Network Out (Bites)”.
- Target Value: Choose the value to maintain the metric at by adding or removing instances as required.
- Instances needed: Choose the amount of seconds that your instances need to warm up.
NOTE: “Application Load Balancer Request Count per Target” is defined as: Number of active connections to targets from the load balancer divided by number of targets.
- Click the “Create” button to create the new scaling policy.
Edit the maximum or minimum number of instances
You can modify the maximum or minimum number of instances chosen in the configuration parameters when you deployed the Bitnami WordPress Production-Ready Stack solution. To do so, follow the steps below:
- Access the Auto Scaling group dashboard and select your Auto Scaling group.
Select the “Actions -> Edit” menu item.
Edit the “Desired Capacity”, “Max” and “Min” values, and click “Save”.
Your Auto Scaling group will be automatically updated.
You can scale your Bitnami WordPress Production-Ready Stack instances vertically by redeploying them on a different AWS EC2 instance type. To do so, it’s necessary to modify the “Launch Configuration” used in the the Auto Scaling group, as follows:
- Log in to the AWS Autoscaling console.
- Under the “LOAD BALANCING” menu, click the “Launch Configuration” link to display the available choices.
Select the Launch Configuration associated with your stack and then select the “Actions -> Copy Launch Configuration” menu item.
On the resulting page, select the “Choose Instance Type” tab.
On the “Choose Instance Type” page, select the new EC2 instance type to use. Click “Next: Configure details” to proceed.
In the resulting dialog, choose “Yes, I want to continue with this instance type” and click “Next”.
On the “Configure Details” page, select a name for the new Launch Configuration. Click “Skip to review”.
On the “Review” page, review the details of the Launch Configuration and click “Create launch configuration”.
In the resulting dialog, select your SSH key pair in the “SSH Key Pair” field, acknowledge you have access to the SSH key, and click “Create launch configuration”.
A confirmation message will be displayed. Click the “View your existing Auto Scaling groups” link to proceed.
Select the Auto Scaling group for your stack and select the “Actions -> Edit” menu item.
Select the new launch configuration you just created and click “Save”.
Your Auto Scaling group will be automatically updated to use the new EC2 instance type.