One of the biggest challenges with running a server-based system such as a website, or the back end for a mobile app, is scalability. If your servers can’t respond to users’ requests sufficiently quickly, your customers will be unhappy. But if you build your service from the outset with too many resources, they will stand idle during quiet times and simply cost you money.
Scaling a service that runs on Alibaba Cloud is easy. You can use the free Cloud Monitor product to keep a watchful eye on your servers, and alert you if specified thresholds (such as too many users, or too few) are reached.
You can also use the load balancer service to help even out demand. Instead of running just one web or database server, for example, create a pool of more than one. The IP address of the load balancer, rather than that of any one individual server, acts as a central entry point. The load balancer then automatically directs incoming requests to the server which is least busy right now. If demand is high, you add more ECS (Elastic Compute Service) servers into the load balancer pool. When demand drops, remove servers from the pool to keep costs down. Your users always get great response times but you’re not paying for unnecessary resources.
Introducing Auto Scaling
At this point you’re probably thinking “wouldn’t it be great if I could automate all this, and add new servers to the load balancer pool whenever Cloud Monitor detects that there is a need to do so”. The good news is that you can do just that, by using an Alibaba Cloud product called Auto Scaling.
To use it, start by logging into your account and, from the management console, enable the feature. Once Auto Scaling is enabled you can configure it via the console. You can specify the maximum and minimum sizes of the load balancer pool, in terms of the number of ECS instances. The auto scaler will then adjust the actual number according to demand, but always within the limits you have set. You can also specify the criteria for adding and removing servers. For example, perhaps you will add a new server to the pool when CPU capacity reaches 80 percent, and remove a server when it drops below 30 percent.
Auto Scaling takes care of adding newly-created servers to the necessary security groups and whitelists automatically, to ensure that they will be accessible. When a server is removed by the auto scaler, the security groups and whitelists are updated. Plus, if a server that has been added to the pool by Auto Scaler becomes faulty, it will automatically be removed and replaced with a fresh instance.
Alibaba Cloud Auto Scaler is free to use. You only pay for the ECS servers that it creates. And of course, once the increased demand subsides and servers are automatically removed in good time, they no longer attract any charges.
Cloud Monitor, Load Balancer and Auto Scaling make it simple to implement a fully scalable solution on Alibaba Cloud, with minimal need for manual intervention as demand fluctuates. You can find out more at https://www.alibabacloud.com/product/auto-scaling