Wednesday, May 16, 2018

Unravelling the mystery of AWS Cost reduction

What is AWS?

AWS, as most of us know, is a way of running a server without the hassle of maintenance costs, better up time and having the flexibility of owning the latest infrastructure, not to mention the possibility of ramping up or down on our resources flexibly.

Most of us have been using AWS as a matter of fact, without knowing much about the details.

If you have been using AWS for a long time, you would have noticed that the cost of running the server has been increasing over a period of time.

This is especially true, if you have been making changes to your server, creating new snapshots, stopping old instances, creating new instances and so on.

Did you wonder why AWS costs are increasing gradually?

The reason is that resources, once created/initiated, will cost us by the hour, however minuscule it may be.

So, the stopped instance, though it may not incur charges, as Amazon claims, the related resources, such as the volumes attached, the snapshots, the AMIs that you use, all add up to the cost that we would be paying for using the Amazon server at the end of the month.

Now, let us see what we can do to reduce our monthly AWS bill.

How do we Reduce AWS Billing costs?

In the first place, we need to identify the resources that are costing us, what are the resources that are costing us, how much each of these resources are costing us, we need to find the split up of the costs.

So, how do we do it? Once you login, go to the "Billing" page when you click under your name (top right)

This Billing dashboard gives you details about services/resources used and the cost till date.

You can select the month for which you want the bill to be shown.

For the present month, we can take a screenshot of the page today. Then come back tomorrow and take another screen shot. A three day screenshot would give us an idea about the cost incurred on every resource type per day; by calculating the difference from the first day to the second day to the third day.

If you notice, there is a category called "EC2-Other" . This is the area we need to focus on. This denotes the Volumes or disk usage for the running and the stopped instances. If we have many stopped instances, it also means that there are many volumes attached to them.

Essentially, these unused volumes or AWS resources are costing you by the hour.

Find out if these volumes are required now. If not, detach them; then delete them. It could cost you around $0.10 per GB per month. So, if you have unused volumes to the tune of 600GB, you could be paying an extra $60 per month on a regular basis.

Take snapshots of instances that you do not need now and then terminate them. If required, you can revive them from the snapshot information. Snapshots generally do not save the unused space. So, if you have a snapshot of a 50GB instance, it will save only the data that is contained in the 50GB instance. If your 50GB instance has 45GB of free space, you will be paying for only 5GB of snapshot storage.

Since, snapshots are stored in S3 by default, though you may not be able to see them in your S3 page, they cost much less than retaining them in the EBS.

Migrate your AWS server from old to new (m1 to t2)

One other option you should consider is to move your server from being in m1 to t2 or the latest.

The general idea is that these new servers provide better performance while costing up to 50% lesser.

The steps to follow would be to create launch a t2 server. Setup all the software necessary to create a copy of the existing m1 or m3 server.

Take a backup of all the source code, database, configuration files and scheduled job scripts/application.

Copy to the new t2 server.

Test the application in the t2 server. Time the migration properly in order to minimize or avoid downtime in the old server. Ideally, it should be at a time when traffic on the server is lean.

Test and then shutdown the old m1 or m3 server.

This exercise may help reduce the running cost of the instance by up to 50%.

Post a Comment

Unravelling the mystery of AWS Cost reduction

What is AWS? AWS, as most of us know, is a way of running a server without the hassle of maintenance costs, better up time and having th... Registered & Protected DWYE-NHTO-NBNH-7FFM