23 Apr 2020
By Mohammed Abubakar
The shear breadth of AWS services and pricing options is both a gift and a curse. On one hand it provides the flexibility to effectively manage your costs and still keep the performance and capacity per your business requirement while but on the other it means you need dedicated resources and processes to ensure that you’re optimising cost.
The fundamental process of cost optimisation on AWS remains the same – monitor your AWS costs and usage, analyse the data to find savings, take action to realise the savings; in this blog I will take a more tactical approach of reducing cost with changes in user demand.
Running instances generate hourly usage charges. Although some scenarios can result in low utilisation by design, you can often lower your costs by managing the number and size of your instances. You can reduce costs by either stopping or downsizing these instances. Use AWS Instance Scheduler to automatically stop instances. Use AWS Operations Conductor to automatically resize the EC2 instances (based on the recommendations report from Cost Explorer).
Use one year, no upfront Compute Savings Plans to get a discount of up to 54% compared to On-Demand pricing. Compute Savings Plans automatically apply to EC2 instance usage regardless of instance family, size, AZ, region, OS or tenancy, and also apply to Fargate and Lambda usage.
If your workloads are fault-tolerant, use Spot instances to reduce costs by up to 90%. Fault-tolerant workloads include big data, containerised workloads, CI/CD, web servers, high-performance computing (HPC), and other test & development workloads.
An EC2 Autoscaling group allows your EC2 fleet to expand or shrink based on demand. Review the scaling activities for each of your autoscaling groups to see if the scaling policy can be tuned to add instances less aggressively. Also review your settings to see if the minimum can be reduced so as to serve end user requests but with a smaller fleet size.
Charges begin when a volume is created. If a volume remains unattached or has very low write activity (excluding boot volumes) for a period of time, the volume is probably not being used. To reduce costs, first snapshot the volume (in case you need it later), then delete these volumes. You can automate the creation of snapshots using the Amazon Data Lifecycle Manager.
Use the Trusted Advisor Amazon RDS Idle DB instances check, to identify DB instances which have not had any connection over the last 7 days. If a DB instance has not had a connection for a prolonged period of time, you can delete the instance to reduce costs. If persistent storage is needed for data on the instance, you can use lower-cost options such as taking and retaining a DB snapshot.
Only pay for what you use by enabling AutoScaling on your existing DynamoDB tables to automatically scale (in and out) your DynamoDB table based on the ConsumedReadCapacityUnits and ConsumedWriteCapacityUnits making it easy to balance costs and performance.
Most AWS users are pretty familiar with Reserved Instances for EC2 without knowing that other AWS services such as RDS also provide huge costs savings through Reserved Instances. Use one year, no upfront RIs to get a discount of up to 42% compared to On-Demand pricing. Make sure you adjust the parameters to one year, no upfront. This requires a one year commitment but the break-even point is typically seven to nine months.
Any load balancer that is configured accrues charges. If a load balancer has no associated back-end instances or if network traffic is severely limited, the load balancer is not being used effectively. Use the Trusted Advisor Idle Load Balancers check to get a report of load balancers that have a low RequestCount over the past 7 days and delete these load balancers to reduce costs.
Use S3 Analytics to analyse storage access patterns on the object data set for 30 days or longer. You can automate moving Infrequently Accessed objects into lower cost storage tier using Life Cycle Policies. Alternately, you can also use S3 Intelligent-Tiering, which automatically analyses and moves your objects to the appropriate storage tier.
With these 10 steps, you can save costs on EC2, Fargate, Lambda, EBS, S3, ELB, RDS, Redshift, DynamoDB, ElastiCache and Elasticsearch. I recommend setting up a budget using AWS Budgets, so that you get alerted when your cost and usage changes. AltoStack are here to help you, please reach out to our experts if you need further assistance setting up a budget using AWS Budgets or optimising your AWS environment.