AWS Cost Saving Tips: Launching EC2 Instances
When launching EC2 instances on Amazon Web Services, it isn’t always obvious how to build EC2 instances that are cost effective. With practically limitless options and sizings, it’s tempting to build servers and their corresponding volumes with more capacity than needed. It’s a “pay for what you use” service, but many times people end up paying for more than they need.. Fortunately, you can control costs and get savings by following a few simple rules.
The following tips can help make sure you’re only paying for the AWS resources that you need. Although this won’t be the case with every EC2 server build-out, thinking with a “start small” mindset can help reduce your spend.
Mistake: Launching an EC2 Instance on a larger instance type right away.
During the initial course of a server build on AWS, users are given the option of choosing an EC2 instance type (see screenshot above). Many people try to guess what the instance type will look like once the server is in production, and will launch a large instance type right away. This means the users pays full price for that larger instance type, even though the resources provisioned aren’t all being utilized.
Solution: Start with a t2.nano/t2.micro, and size up instances when necessary.
Unless you are spinning up a production instance with a pre-defined configuration, start with the smallest instance type available and work your way up as need. You might fin your application will run fine on a t2.nano or t2.micro, due to the bursting capabilities of the t2 instance family. If you find you need more computing or memory resources, you can stop the instance and move up one instance size via the Instance Settings menu.
Mistake: Going with GP2 (SSD) Volumes instead of Magnetic.
When launching an EC2 Instance, Amazon will recommend GP2 volumes by default. GP2 volumes give better IOPS performance, but most small to medium business apps can run on the basic Magentic volumes. GP2 volume cost twice as much as magnetic volumes, which can add up when using multiple large volumes on your EC2 instance.
Solution: Use Magnetic Volumes instead of GP2
Most servers can use magnetic volumes without any noticeable effect on performance. Large data storage volume costs can be cut in half by choosing Magnetic over GP2 volumes. If you find IOPS are in issue in the future, you can swap out the volumes via snapshotting and re-launching.
Mistake: Leaving EC2 Instances running 24/7.
(Visualization of a t2.large instance that is powered off overnight. This saves 25% of the instance cost per month)
Amazon charges end-users by the hour for all powered on and running EC2 Instances. Stopped instances do not incur compute charges hourly. The mistake most people make is leaving instances on 24/7 when they don’t actually need to be running.
Solution: Stop EC2 Instances when not in use to reduce EC2 Instance hours.
The easiest thing to do to reduce cost is to make sure your instances are only running when they need to be. Turning off Instances that are not in use will minimize billable hours. Only turn them back on when necessary, and you’ll drastically cut back on running hours for the month. You can also use automation tools to set schedules and “park” instances when not in use, and reduce overall charges. One usecase would be turning off a small business internal application over the weekend, or powering down an application overnight.
By avoiding the mistakes above, and putting yourself in an “only run what is necessary” mindset, you can reduce AWS EC2 costs significantly. Building AWS services with this mindset will help avoid unwanted surprises in your monthly AWS bill.
Enjoy these tips? Get AWS Cost Savings and other insights delivered weekly.