The AWS EC2 pricing calculator is a very handy tool and if you use it properly, it can help you to save a lot of money. Like all tools, however, you need to understand it to use it properly. This means not just understanding what it does do, but understanding what it doesn’t do.
The AWS EC2 pricing calculator just processes the information you enter
The AWS EC2 pricing calculator does your pricing for you, it doesn’t do your thinking for you. In other words, if you tell it you want a certain configuration, it will tell you how much that configuration will cost. It will not tell you whether or not that configuration is a good idea. In particular, it will not tell you whether or not that configuration is sized effectively.
Right-sizing is the key to reducing the cost of EC2
Right-sizing is one of the keys to cost optimization in general and it’s particularly relevant to storage solutions such as EC2. This means that it literally pays to make time out of your busy schedule to keep an eye on your EC2 usage and make sure that it actually does reflect your needs – no less and no more. With that in mind, here is some guidance on how to manage EC2 right-sizing effectively.
Focus on the areas of biggest spend
Even though little savings can add up, bigger savings can add up even more quickly. This means that your priority should usually be the places where you are currently spending the most money.
Ensure that you’re only working on areas which are likely to be stable for the next few months
On similar logic, you also want to focus your efforts on areas which are likely to be stable for the next few months (at least) otherwise all your work could just be wasted when it is changed.
Keep an eye open for areas which are due to change soon
You don’t (usually) want to go through a right-sizing project for these areas as they are now, but you do want to know about any changes which are due to happen as this is an opportunity to ensure that new areas are right-sized from the get-go (and to schedule checks to ensure that they continue to be right-sized as time goes on).
In particular, you want to give yourself plenty of time to think about what reserved instances you’re going to need, so that predictable work is done at the most economical price and you’re not left crossing your fingers and hoping to get lucky and pick up spot instances to save your budget.
Pay attention to AWS’ instance lifecycle
AWS uses a “carrot-and-stick” approach to getting customers to migrate off instance types it wants to retire and onto new ones it is introducing. It increases the prices of the former and makes the latter more economical by comparison. This means that being prepared to use different instance types can save a whole lot of money. Try to make a point of checking in with the AWS website to keep up to date on what Amazon has planned as this can give you a good hint as to what the pricing trends are likely to be going forward.
Practice good EC2 hygiene
To begin with, make sure that you apply complete and accurate tagging to all your resources. This step can be very easy to miss when you’re busy, but it can make life a lot easier when you want to analyze specific areas of your application environment.
You might also find it very helpful to define a new gate in your continuous delivery workflow during the staging process to make it easier to confirm your capacity requirements before deploying to production. Ideally, you will also want to install an agent to monitor your memory usage, which can significantly influence any decisions relating to EC2.
Work off exact usage information not guesses
The key point here is that you need to factor in all aspects of your computing resource needs when taking what type of EC2 instance you need and what size it should be.
Currently, AWS reporting will show you CPU, and I/O utilization for each volume attached to your EC2, plus data on the network usage of each of the network interface cards attached to your EC2. What it doesn’t currently provide is data on memory utilization, hence the advice to install an agent, since the alternative may be to work off educated guesses, which may be better than nothing, but not necessarily a great deal better.
Consider using third-party tools
Accurate data on actual usage will give you a solid basis for working out what kind of resources they will require. In particular, you’ll want to compare using general-purpose EC2 instances with optimized instances. This can be done manually, but if you undertake this exercise regularly, you may find that third-party tools quickly pay for themselves, not just in cost savings but in saving you time, energy and possibly frustration.