In this video, Jeff Winesett describes how to keep cloud costs low by ensure supply matches demand. Using CloudWatch, AWS Trusted Advisor and understanding different resource cost profiles help keep costs low when using the cloud.
- [Instructor] AWS allows for the use of only the needed resources exactly when they are needed and only having to pay for them when being used. Taking advantage of the elastic nature of the cloud means realizing just-in-time infrastructure to be able to continuously keep the supply of resources in sync with the demand for them. Optimally matching supply to demand is one of the best ways to ensure the lowest costs for a system. When architecting to match supply with demand, thought needs to be put towards identifying patterns of resource usage, the approaches available for provisioning additional resources, and the time it takes to do so.
Consider queue-based systems or auto scaling to handle production traffic spikes. And beyond just considering production traffic, don't overlook the day-to-day operations and development processes as areas for optimizing the match between supply and demand. For example, development and test environments are typically only used during normal work hours. These could be stopped during the nights and weekends when they are not in use. This could result in considerable cost savings.
For example, paying for just 40 hours a week versus 168 hours will save close to 75%. The simplest way to optimize for cost is to not pay for things that are not needed. One of the best tools to use to determine if there are idle resources being paid for in an account is to use the cost optimization feature within AWS Trusted Advisor. It checks over 100 configurations and recommend savings.
It provides information about low utilization on EC2 instances, idle load balancers, underutilized DBS volumes, unassociated elastic IP addresses, idle RDS DB instances, and underutilized Amazon Red Shift clusters. It's available with business or enterprise support and one of the best ways to quickly determine if your supply is outweighing your demand. Beyond optimizing the number of resources to use and when to be using them, consideration needs to be given to the types of resources being utilized for the use case.
For example, even if using only one EC2 instance, is that one instance correctly sized? It takes more than a bicycle to tow a freight train, but a freight train is not needed to carry a load that would fit in a pickup truck. To determine if there is a mismatch here, CloudWatch can be used to monitor instance metrics overtime. This way, actual usage can be compared to actual needs and can help determine the appropriate instance type.
This matters because just as freight trains have a different cost profile than pickup trucks, different instance types and instance sizes cost different amounts and there are a lot of instance types. Instances are first categorized by families. General purpose, compute optimized, memory optimized, storage optimized, and accelerated computing. And then within each family, there are many types having different combinations of CPU, memory, storage, and networking capacity.
And these have different price profiles. Here is just an example of the monthly cost differences between some of these instance types. There is an instance type called T2 which offers a good example of how understanding the different types of resources can make a difference to costs incurred. The T2s offer what it is called burstable performance. Burstable performance instances provide a baseline CPU performance with the ability to burst above that baseline based on credits.
T2 instances are for workloads that don't use the full CPU often or at least not consistently, but occasionally need to burst. These are great for web servers or development servers that don't need consistently high levels of CPU, but do sometimes need and often benefit from having full access to very fast CPUs from time to time. Comparing the T2 against those in other families that deliver constant compute shows considerable cost savings even when compared to instances with less CPU or memory specifications.
The T2 can burst up to the same capacity of a c3.large. So if the capabilities of a c3.large are needed occasionally but not consistently, the t2.medium is the ideal instance to match supply with demand and optimize for cost. Optimize for cost lesson number two. Matching supply with demand is the key to optimizing for cost when using cloud resources. Use tools such as CloudWatch to monitor usage patterns and AWS Trusted Advisor to identify discrepancies between usage and need, and stay aware of different resource types available to ensure the right tools are being chosen for the jobs at hand.
- Benefits of cloud services
- Making architectures scalable
- Examining cloud constraints
- Virtual servers, EC2, and Elastic IP
- Using the Amazon machine image
- Elastic load balancing
- Using CloudWatch for monitoring
- Security Models
- Elastic block storage
- S3, CloudFront, and Elastic Beanstalk
- Handling queues, workflows, and notifications
- Caching options and services
- Identity and access management
- Creating a custom server image
- Application deployment strategies
- Serverless architectures