Good old AWS, the mercedes benz of cloud server hosts. I was at AWS today, and I got a better understanding of how to best run Ec2 servers to save in costs. ;) If you log into the AWS console and, in the upper right corner, click on your name and then "My Billing Dashboard". You will then be taken to a page that shows you the estimated costs of what you should expect to pay so far for this month. Personally though, I prefer to look at the bill for the previous month(s) to see where there were high expenses. One you are only the billing dashboard, look on the left for a link that says "Bills". This will take you to a page with a more detailed breakdown of exactly what AWS services correspond to what charges. A key thing to note about Ec2 linux servers is that you do not get charged for starting and stopping- you are charged per hour that each sized server is running. That means that you should be charged the same whether you have 5 micro instances running for 100 hours a month each or one instance running for 500 hours a month. A good way to save costs is to stop your Ec2 servers whenever you don't need to have them running. Better yet, more everything to AWS Lambda (but I get it, some things need to be continuous processes running all the time so sadly you can't easily move them to serverless. :( The next best thing to serverless is having your Ec2 servers automatically start and stop. This can be done relatively easily by writing some code using the 'ec2' library in javascript, python, java, etc. that calls the "startServer" and "stopServer" functions. This way you are only paying for the hours you need the servers to be running and not wasting costs and times when nothing is even hitting it (such as in the wee hours of the night, weekends, etc. The Bills page is really nice because it breaks down your costs by each AWS service, but what if you want things broken down even finer than that? Suppose you have one AWS account but many engineers on multiple teams and you want to know how much of the Ec2 costs are attributed to one teams servers and how much is attributed to the other team's servers? Welp, our friends at AWS thought you might want that feature so they created it and called it "allocation tags". This lets you tag things to be broken down cost-wise so that you can look at the different tag groups and compare them to each other.
0 Comments
Your comment will be posted after it is approved.
Leave a Reply. |
AuthorThe posts on this site are written and maintained by Jim Lynch. About Jim...
Categories
All
Archives
March 2023
|