noshornoshor

by System Admin

Our monthly cost at end of the 2016 December is USD 2516 so our client wants me to reduce cost to USD 1500 and they asked me to finish cost optimization things.

So I did start work on cost optimization, first I did check Amazon Web Service (AWS) billing console and find out monthly costing of each AWS services

Then I found our EC2 services monthly cost USD 1658 (USD 842 EC2 instances + USD 751 EBS volume cost + USD 65.19 ELB ) because we are using 20 EC2 instances I could understand USD 842 for EC2 instances cost is okay but EBS volume cost 751 and its too much also I did check that we did allocate total 8000 GB space to our applications but only 500 GB volume are consumable 7500 GB space not we were using and 7500 GB size cost monthly is USD 747 so then I have decided reduce all EBS volumes size.

So I did find out some EC2 instances which had attach large space EBS volume and space utilization only 1-2 % of total size.

So there were  total 6 instances which each had 1000 GB root volume

3 instances were running on production setup  from out of 6 instances and another 3 instances were using for development

So I decided to first shrinking volume for development instances but shrinking root volume from 1000 GB to 50 GB

So I did create snapshots from ebs root volumes of all of these three development instances then did create volumes (1000 GB each) from those snapshots also create three small volumes size of 50 GB each

Then I did mount three 1000 GB volume to respected EC2 instances also I did mount 50 GB empty volumes to respected EC2 instances

So our three each EC2 instances there volumes , one volume is root size 1000 GB (xvda) another volume created from snapshot 1000 GB (xvdf) and last 50 GB (xvdg) empty volume .

Then I was going transfer all files from xvdf volume to xvdg byte to byte using dd command this process took 2-3 hours also I did install some GRUB kernel in xvdg volume so this volume able to boot properly

After I did detach all volumes from the instances and attach 50 GB xvdg volume as root after successfully running instance I did delete 1000 GB volumes

So now all these three dev instances total using 150 GB instead of 3000 GB volume

Same I did do for production instances but for production instance client not afford downtime so I did shrink volumes for production instances at weekend with downtime for 2 min on each instances.

So same as dev instances ,production instances also using 150 GB volume instead of 3000 GB volumes

So now our total 6000 GB shrink to total 300 GB so we now saving cost around

Total cost

6000 GB = 597 USD

300 GB = 27 USD

597-27 = 570

As per calculation now we are saving around 570 USD on EBS volume per month

So total AWS monthly cost USD 2516 to USD 1946

Now but client wanted to cut down cost so I did start looking on AWS billing area and check that I found out our Amazon Elastic cache service monthly bill around USD 324 so I did start looking at our Amazon elastic cache Redis cluster and find we were using 2 nodes on Redis cluster then I did talk with developer team about some their caching server requirement after that I came to decision that we need only one node so I had delete another node so our cost is now half around 162 USD

And also we had still one volume left with 1000 GB volume , actual space utilization by us 140 GB  this volume we did use for some important content so I did transfer those all content to Amazon EFS storage

And deleted that 1000 GB Volume so by doing this we could save 90 USD per month

So I did finish this stuff around in middle of Jan and our cost start decreasing from

2516 to  25160-570-162-90 = 1738 USD.

sysop
About sysop
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.