By Pablo Puig
As of 2021, more than 455 million websites use WordPress, including large organizations and newly launched startups. Scalability is a crucial part of running a successful WordPress website. You cannot predict what might trigger a traffic spike – viral posts, celebrity endorsements, or marketing campaigns. The major boost of your brand must be handled carefully. Therefore, scaling a WordPress website for high traffic is an important task. This article explains how to scale a WordPress website hosted on Alibaba Cloud.
Alibaba Cloud Auto Scaling allows you to automatically adjust the number of compute resources of your application based on user requests.
When the demand to access your application increases, Auto Scaling automatically adds ECS instances to the pool to handle the extra incoming traffic. When the traffic is low compared to the compute resources in the application pool, Auto Scaling will remove a few instances to keep the costs down.
Auto Scaling is free to use, and you only pay for the compute resources or ECS instances used in your architecture.
The following step-by-step guide explains how to set up Auto Scaling from the Alibaba Cloud console.
Log in to your Alibaba Cloud account and go to Auto Scaling:
Select a region from the top navigation bar, select Scaling Group, and click Create:
Configure the parameters and click OK to create the Scaling Group. You can set the following parameters:
· Tag: Use tags to categorize resources in the Alibaba Cloud environment
· Instance Removing Policy: Choose a policy to remove instances, such as which instance needs to be removed first. If multiple instances fulfill the condition, a random instance will be removed.
· Suspended Processes: You can suspend a particular process before an operation. For example, suspend the health check process before stopping the ECS instance
· Enable Deletion Protection for Scaling Group: You cannot delete the scaling group from the console if you enable this option.
· Health Check for Instances: Once you enable this feature, the Auto Scaling group will check ECS instance health regularly. An unhealthy instance will be removed from the scaling group.
· Minimum Number of Instances: Enter 1 (A Scaling Group must contain at least one instance. If there are fewer instances active than the minimum number of instances, Auto Scaling will add instances to reach that number.)
· Maximum Number of Instances: 4
· Expected Number of Instances: It retains a certain number of instances in a scaling group
· Default Cooldown Time (Seconds): During this time, activities from event-trigger tasks will be rejected.
· Network Type: You can choose VPC or Classic Network
· Scaling Policy: If you have specified VPC as a Network Type, you need to add a scaling policy. You can choose from Priority Policy, Balanced Distribution Policy, or Cost Optimization Policy.
· VPC: Select an existing VPC
· VSwitch: After VPC, you need to choose a VSwitch. Every VSwitch resides in a single zone. Select VSwitch from multiple zones to deploy ECS in multiple zones
· Add Existing Instance: Since we have chosen the Instance Configuration Source as the Select Existing Instance, we need to choose an instance to add to the scaling group.
Associate CLB (SLB): Choose an existing Classic Load Balancer (CLB). ECS instances will be added as a backend to that CLB. This CLB must be in the same region as the Scaling group. It must be in the same VPC to ECS instance.
Associate ALB Server Group: You can also associate an Application Load Balancer (ALB), and it will add ECS instances as the backend to process requests.
Associate RDS Instances: Associate an existing ApsaraDB RDS instance with a scaling group. It will add internal IP addresses of ECS to the whitelist to allow internal communication. The RDS instance and scaling group must be in the same region.
We will create a Scaling Configuration and associate it to the recently created Scaling Group:
Navigate to your Scaling Group and click Instance Configuration Sources on the upper side. On the next page, click Scaling Configurations and Create Scaling Configuration on the left corner:
Configure the parameters and click OK to create the Scaling Configuration. You can set the following parameters:
Billing Method: Pay-as-you-go
Instance Type: The type of instance to add
Image: Image or operating system of the instance
Enable the Scaling Configuration by clicking Enable Configuration:
We already created a Scaling Group and a Scaling Configuration, but we need a Scaling Task to trigger the Auto Scaling. It will define when we need to scale up and scale down. In our case, we will create a scaling rule to add an instance automatically if CPU usage is more than 70%.
There are two different types of Scaling Tasks. In our case, we will create an Event-triggered Task by clicking Create Event-triggered Task:
Configure the parameters and click OK to create the Scaling Task. You can set the following parameters:
Task Name: Give it a name
Description: Description of the task
Resource Monitored: Choose the scaling group you just created
Monitoring Type: System Monitoring
Monitoring Metrics: (ECS) CPU Usage
Reference Period: Enter 1 to collect data every 1 minute
Condition: Average>= 70% (If the average CPU utilization is equal or more than 70%)
Trigger After 5 Times (If the condition is met 5 times, an alert is triggered)
Alibaba Cloud provides everything you need to scale your WordPress website without doing anything manually. Alibaba Cloud Auto Scaling is a tool that helps automatically scale your resources in and out cost-effectively.
How to Find out Which Active Directory Groups You Are a Member Of
First Olympic Winter Games to Host its Core Systems on Alibaba Cloud
1,037 posts | 254 followers
FollowAlibaba Clouder - June 2, 2020
Alibaba Clouder - July 8, 2020
Alibaba Clouder - July 20, 2018
Alibaba Clouder - August 15, 2018
Alibaba Clouder - December 6, 2016
Alibaba Clouder - July 2, 2019
1,037 posts | 254 followers
FollowAuto Scaling automatically adjusts computing resources based on your business cycle
Learn MoreExplore Web Hosting solutions that can power your personal website or empower your online business.
Learn MoreExplore how our Web Hosting solutions help small and medium sized companies power their websites and online businesses.
Learn MoreWeb App Service allows you to deploy, scale, adjust, and monitor applications in an easy, efficient, secure, and flexible manner.
Learn MoreMore Posts by Alibaba Cloud Community