AWS Scalability Management Guide
Scalability Guide for AWS Users
In this session, we will discuss how to build Automatic Horizontal Scaling (Scale Out) in your AWS environment. There is prerequisite for your application and architecture to support the ability of Horizontal Scaling prior to defining Auto Scaling, and etc.
There are two main Scaling methods, Vertical and Horizontal Scaling. Each method has different attributes, each with its own Pros and Cons, but the question is not “which one is better?“ rather “which one best suits me?” based on the phase your application/service is facing. The following table compares the main features of the two scaling methods:
|Vertical Scaling||Horizontal Scaling|
|Solution||Increasing the demand of the resources in use. This can solve core issues and system bottlenecks that create loads. Simple to perform, and helps with cloud adoption.||Use of additional resources upon load.Generally solves load of client requests on the web servers, hence supports usage growth|
|Cost considerations||Expensive. Scaling up by one pricing level causes additional operational costs.||Scaling out usually includes adding cheap hardware resources. Maintenance will add additional costs to operation.|
|Availability||Single point of failure.||Strengthens the system robustness.|
|Scalability||There will be a maximum size that you can purchase.||The IaaS providers aim to provide a cloud with an infinite amount of resources. There is no limit for horizontal scaling in such an optimal environment.|
|Provisioning||The actual scaling function involves downtime.||Demand should be predicted early enough so that resources provisioning can be enabled before the peak.|
You can read more here about the different scaling methods.
How to build an Elastic environment (Auto Scale Out and Shrink upon usage)
If your application is serving end users and its performance is mainly driven by users’ high-load, you should consider building the ability to scale horizontally (Scaling-Out).
- Create your application to be scalable
- Architect your environment and application for elasticity – If you know your application might have ‘bottlenecks’ in terms of performance due to high load by your customers, build it to be able to scale-out.
- Get to know your application
- Identify the constraining resources (CPU, Memory, IO, etc.) that serve as triggers for the Auto Scaling process.
- Use Elastic Load Balancing (ELB) to balance the load between the resources
- Use Auto Scaling – If you are signed up for the Amazon EC2 service, you are automatically registered for Auto Scaling. Read more here about Auto Scaling and how to define it
- Monitor your resources usage in CloudWatch
- Export your own metrics if necessary so you could automate the scale-out process
- Free Tier of CloudWatch provides 5 min. resolution; if greater granular is needed, even 1 min. resolution can be achieved
- Set up alerts based on your resources
- Automate configuration
- Consider using script automated tools such as Puppet/Chef /Cloud Formation
- Build Startup/Shutdown scripts
- Keep configuration files up to date
- Share resources between different services
- Deploy changes instantly
- Create AMIs (and constantly update/maintain them) with everything you need for the purpose of scaling out
- Required packages and applications
- Configuration files
- Startup/Shutdown scripts
- Create Auto Scaling groups and policies
Dos and Don’ts
- Scale up quickly
- Measure how long it takes for an instance to get into service
- Consider EC2 launch times and applications
- Scale down slowly
- Don’t take down all of your resources at once!
- We suggest not committing on servers if you are not going to heavy utilize them - remember you are committing to Utilization and not for the machine itself
- Don’t put all of your eggs in one basket. Outages are very likely to happen, so build smart and be ready for the worst case
How To Guides
- How to create Auto-scaling Policy
- How to create an AWS Elastic Load Balancer
- How to Attach Instances to an Elastic Load Balancer
- All about Auto Scaling on AWS website
Please read this Case Study from one of our Design Partners who maintains a full elastic AWS environment